Hi,
I am using Cells to convert CSV files to Excel files with the capability for macros. After one run, the documents open fine, but if I run again there is an Excel error saying “We found a problem with some content in filename. Do you want us to try to recover as much as we can? If you trust the source of the workbook, click Yes.”
I am doing my development in WinForms C#, and the goal is to have these files update on a button push and then the macro run automatically when the data is changed. What could be causing the issue when I run more than once? Here is the outline of my code:
var workbook = new Workbook(path1Csv);
FileStream outFile1 = new FileStream(outPath1Xlsm, FileMode.OpenOrCreate, FileAccess.Write);
workbook.Save(outFile1, SaveFormat.Xlsm);
outFile1.Close();
workbook = new Workbook(path2Csv);
FileStream outFile1 = new FileStream(outPath2Xlsm, FileMode.OpenOrCreate, FileAccess.Write);
workbook.Save(outFile2, SaveFormat.Xlsm);
outFile2.Close();
…etc.