107
Views
2
Comments
Solved
[Advanced Excel] Cell_WriteRange prints last row in row 2
advanced-excel
Service icon
Forge asset by Carlos Freitas
Application Type
Reactive

Hello,

I'm using AdvancedExcel to export data into excel. But I'm facing problem while printing correct data.
I'm using Cell_WriteRange to write data into excel file, but I found that the last row (whatever it is) is printed in Row 2 (which is the row after headers).

correct data to export in excel:

data that is exported :

structure just before Cell_WriteRange:

structure just after Cell_WriteRange:

I'm scratching my head from last 2 hours, I don't know what is making this overwrite the first row only. Also, below is the actions during the excel export. I don't have anything between Worksheet_Select and Cell_Write except and If condition.


Thanks,

Aman

2024-04-15 16-08-47
Aman Devrath
Solution

I would like to know the origin of the issue as I couldn't find it on my own. If any of the developer see this please help find/solve this issue.

Hi all,

Since I couldn't find the origin of the issue, there was no built-in solution for this.

But I was able to solve the problem. 

I had to overwrite the second row (B row). Used Cell_Write for this. Passed "B"+rowVar as Cell Value and used for loop. Added 1 to rowVar after every loop.

NOTE : Use Cell_Write after you've already written the data using Cell_WriteRange. When I used Cell_Write before using Cell_WriteRange, second row was overwritten as mentioned in the question. So use Cell_Write AFTER using Cell_WriteRange to only overwrite the required row, not other data.

2022-08-03 04-32-50
Ravi Punjwani

Hi Aman,

Try debugging the .Net extension of Advanced Excel from your environment.

https://www.outsystems.com/forums/discussion/16230/how-to-debug-a-net-extension/

2024-04-15 16-08-47
Aman Devrath
Solution

I would like to know the origin of the issue as I couldn't find it on my own. If any of the developer see this please help find/solve this issue.

Hi all,

Since I couldn't find the origin of the issue, there was no built-in solution for this.

But I was able to solve the problem. 

I had to overwrite the second row (B row). Used Cell_Write for this. Passed "B"+rowVar as Cell Value and used for loop. Added 1 to rowVar after every loop.

NOTE : Use Cell_Write after you've already written the data using Cell_WriteRange. When I used Cell_Write before using Cell_WriteRange, second row was overwritten as mentioned in the question. So use Cell_Write AFTER using Cell_WriteRange to only overwrite the required row, not other data.

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