187
Views
8
Comments
Solved
Excel Corrupt - Excel Package

Hello.

I'm using the "excel_package" from the forge in order to write over an excel template. 

When I download the excel file I get this error message:

Here is part of my flow: 


I have tried with less cell, simpler cells and to change the mime type... The same error always appears.

Any ideas?


Thank you.

2025-09-25 22-50-38
Hanno
Solution

Erica, are you perhaps writing formulas to the cells? Improperly formatted formulas could also cause that message.

UserImage.jpg
Érica Gomes

Hanno wrote:

Erica, are you perhaps writing formulas to the cells? Improperly formatted formulas could also cause that message.


Yes, i have formulas on the other sheets of the excel that depend on the data that I'm inserting on this sheet...

I'll take a look at them.

Thanks

2022-05-25 10-40-45
Hugo Duarte

Hi Erica,


There are a lot on info that i'm going to have to guess from the prints, but i'll try to help.

Try and close the workbook before getting the binary;
Try and set mime type to default :

"application/octet-stream"

Check if the request is submit.


Hope it helps.

UserImage.jpg
Érica Gomes

Hi. Thanks for replying.

I have previously tried to change the mime type, same error.

When I try to close the workbook, I get this error "Object reference not set to an instance of an object."

Yes, request is submit.

2022-05-25 10-40-45
Hugo Duarte

Hi again,


Since you are using a template, before applying any changes to the open workbook use the function 

Worksheet_SelectByIndex

To select the work sheet that you want to apply changes, in this case cell by cell like you have in the foreach.

In the end Get the binary data from the opened file, not the Worksheet_SelectByIndex.


Hope it helps.



UserImage.jpg
Érica Gomes

Hugo Duarte wrote:

Hi again,


Since you are using a template, before applying any changes to the open workbook use the function 

Worksheet_SelectByIndex

To select the work sheet that you want to apply changes, in this case cell by cell like you have in the foreach.

In the end Get the binary data from the opened file, not the Worksheet_SelectByIndex.


Hope it helps.



I'm already using the WorkSheet_SelectByIndex (it's the Worksheet_Master in my flow).
And I'm using the worksheet to write the cells.

The binary data is coming from the opened file (Workbook).

Thank you for replying anyway :)


2025-09-25 22-50-38
Hanno
Solution

Erica, are you perhaps writing formulas to the cells? Improperly formatted formulas could also cause that message.

UserImage.jpg
Érica Gomes

Hanno wrote:

Erica, are you perhaps writing formulas to the cells? Improperly formatted formulas could also cause that message.


Yes, i have formulas on the other sheets of the excel that depend on the data that I'm inserting on this sheet...

I'll take a look at them.

Thanks

2025-09-25 22-50-38
Hanno

Erica, were you able to find and resolve your problem?

UserImage.jpg
Érica Gomes

Hanno wrote:

Erica, were you able to find and resolve your problem?


Yes, one of the sheets had some formula issue... I just tried to change the template, deleting one sheet each time until it worked without one of them. Actually, the sheet with the wrong formulas was not important so I just decided not to include it.

Thank you for your help!

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