cmdFormat.Apply applies to all rows and gives large files
Posted: Wed Aug 07, 2013 2:12 pm
Hi,
In Axolot 5 - On Export setting the regions that you don't want to protect using the code below, works as expected, however, when you then read the worksheet the row count reported by Excel and used to load just the rows with data in them into memory is incorrect.
//writing file, unlocking a region.
self.oXLS.CmdFormat.BeginEdit(self.oXLS[0]);
self.oXLS.CmdFormat.Protection.Locked := False;
self.oXLS.CmdFormat.Apply(iC1, iR1, iC2, iR2);
//then setting password.
self.oXLS[0].Protection.Password := FsExcelPassword;
On reading the file when I now get the Excel row count it says there are 65536 rows in the worksheet when in fact there are only 6. This is causing a problem when loading the data into memory for validating. When we use the OLE Excel Protection methods the Excel row count is not affected.
Can you help?
Thanks in advance.
In Axolot 5 - On Export setting the regions that you don't want to protect using the code below, works as expected, however, when you then read the worksheet the row count reported by Excel and used to load just the rows with data in them into memory is incorrect.
//writing file, unlocking a region.
self.oXLS.CmdFormat.BeginEdit(self.oXLS[0]);
self.oXLS.CmdFormat.Protection.Locked := False;
self.oXLS.CmdFormat.Apply(iC1, iR1, iC2, iR2);
//then setting password.
self.oXLS[0].Protection.Password := FsExcelPassword;
On reading the file when I now get the Excel row count it says there are 65536 rows in the worksheet when in fact there are only 6. This is causing a problem when loading the data into memory for validating. When we use the OLE Excel Protection methods the Excel row count is not affected.
Can you help?
Thanks in advance.