102
Views
6
Comments
[Advanced Excel] Err: Length cannot be less than zero. Parameter name: length[when getting the binary]
advanced-excel
Service icon
Forge asset by Carlos Freitas
Application Type
Reactive

Hi all, 

I was trying to read a template  (.xlsm) from the resource which having macro in it. What I wanted to do is that I want to write into the row/column that will be used by the macro and populate the data in another column. 

What I did is that I used Workbook_Open, Workbook_Select (Selected the one which will be used by macro), Write into specific row/column, Workbook_GetBinaryData (Having an issue here), and Workbook_Close.

I tried to download the file directly and it worked. From what I understand is that the error occurred when there's no data in Excel? Correct me if I'm wrong here. But the other data is in the template already, just that I need to populate another data in the specific row/column for the Macro to process. 

Any feedback would be very much appreciated. Thanks.

Regards,

Kenny

2020-11-07 09-14-54
Pranav Shingane

Hi @Yung Shin ,

Can you upload some images and mark the requirement or error you observe. It will helpful to understand more

2023-11-14 07-36-16
Yung Shin

Hi Pranav,

Good day. The attached below is the flow of the server action.

This is the resource used that containing the macro.
I require that I only need to write the specific result into the.xlsm file and the macro will be running based on the result written into the file. I guess there's no issue with the writing part since everything worked fine until the Workbook_GetBinaryData action and prompted that error.


Regards,

Kenny

2024-07-16 17-36-51
Shradha Rawlani

Hi Yung ,

Please share the sample oml of the issue, it will be helpful to resolve the error

Regards

Shradha


2023-11-14 07-36-16
Yung Shin

Hi Shradha,

I have replicated the issue in my personal environment.
Link: https://personal-9rpjqwc0.outsystemscloud.com/ExcelFile/Screen1?_ts=637574619282214373

I've attached the .oml file as below as well.

Here's the full error log.


Edit: In this .oml file, I did not include the writing part because it's working properly in another environment and the data is from another environment as well. I tried to create a new workbook and it's working fine also. Will that be an issue on the .xlsm file itself?


Regards,

Kenny

ExcelFile.oml
UserImage.jpg
shipra joshi

Hi everyone
 

i am also facing same error on same function. but the same code is executed some time.
some one find exact reason of this issue.

2023-11-14 07-36-16
Yung Shin

Hi Shipra,

Hope you are doing well. In my case, I had to isolate column by column to identify the column (used by macro) with issues. I am able to generate the excel after I removed the unused column. Not sure if this will help in your case.

Regards,

Kenny

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.