[Advanced Excel] Err: Length cannot be less than zero. Parameter name: length[when getting the binary]
Forge component by Carlos Freitas
Application Type

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.



Hi @Yung Shin ,

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

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.



Hi Yung ,

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



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?




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