Hi everyone.
I have some codes to open,
fill data and save XLSM/XLTM files. But, after save the file, the
Microsoft Excel show me some errors while opening the file.
Translating:
We found one problem with the
'REPORT_grading_bulgaria_20191219171235628.xlsm' file content. Do you
want we try to recover the maximum possible content? If you trust in
this workbook source click Yes.
Even clicking Yes, a new error message is shown:
This messages shows me that the file was not completely recovered or repaired. To open the file, I used this code:
FFlexCelExport.Open(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)))
+ 'models\grading_bg_model_barley.xlsm', TFileFormats(5), ';', 1, 1,
[], TEncoding.UTF8, True);
And to save the file I'm using this code:
FFlexCelExport.Save(FFileName, TFileFormats(5));
Where FFileName receives the complete path to the file and its name, preserving the original file extension.
There's any other parametrization or method to open and save XLSM/XLTM files that avoid the errors while opening file?