Hi,
I open an Xlsm file (the modification of this file is protected by a password), I update some cells and I save as xls file.
In the xlsm file, I have protect area, some macros and I want to have the same protect area and macros in my destination file (format xls).
But in my case, my destination file have not protect area.
Can I have the same contains (protect area) from xlsm file to xls file ?
My code is :
sFileName := 'c:\test.xlsm';
Xls.Open(sFileName);
Xls.SetCellValue(5, 17,'write something');
sFileDest := 'c:\test.xls';
Xls.Save(sFileDest);
Thanks
Hi,
Hi,
If I convert xlsm to xlsx, protect areas are converted ?
Thanks
Joel
There is no real conversion between xlsx and xlsm: They are basically the same format with some different headers. And yes, they are preserved when you open xlsx or xlsm and save xlsx or xlsm. They are also preserved when you open xls and save xls. What we don't do is to convert between xls and xlsx/m. Note that xls and xlsx are completely different: One is a binary format and the other is a zipped xml. Xlsx and xlsm are the same file format, except xlsm allows you to have macros and xlsx doesn't. If you save macros in xlsx, Excel will refuse to open them.
My client give me a xlsm file with some protected areas and I have to fill some cells and I save it to a new type (xls or xlsx). But in my case, I lose the protected areas if I save on xls or xlsx format. If I save with the same original type, it is ok.
I will save it with the native type. (xlsm).
Thanks for all.
Joel