I use DBAdvGrid2.SaveToXLSSheet(RzSaveDialog1.FileName,'InfoData');
If this sheet already exist in the excel file, it asked you to overwrite.
I expected to overwrite the sheet, but it is overwriting the rows.
If previously the sheet was filled with 100 rows, and with this savetoxlssheet, only 50 rows.
Then only the first 50 rows are overwritten and the other rows keeps the old information.
Is it possible to overwrite the sheet complete ?
By design, this function SaveToXLSSheet() will connect to an existing XLSX file / sheet (when it exists) and export into it without affecting other cells that are not within the range of the TAdvStringGrid cells.
If you do not want this behavior, either first programmatically delete the XLSX file or programmatically delete or clear the .XLSX sheet before exporting.
Thanks for your reply.
Makes the behavior clear