Workbook wb = new Workbook(FileFormatType.Xlsx);
Worksheet sheet = wb.Worksheets[0];
wb.Save(filePath, new OoxmlSaveOptions(SaveFormat.Xlsx));
I am working for the issue that is occurring on the IIS server to write in excel sheet. I am able to write it on localhost with no error when the web application is run in visual studio, but as soon as I publish it on IIS, it writes the error INVALID_OPERATION , “The ConnectionString property has not been initialized…” instead of the correct text that i wrote on it. I have updated the Aspose Cells nudget package to the latest.
I have also tried copying a sample excel sheet to clone it and create a new one from it , but still the correct text is not written on it.
I have used the above mentioned code.
Please help me to resolve this issue.
@sajidahmad,
You need to pass the file name of the workbook that you want to load so try changing your code to below sample and let us know your feedback:
Workbook wb = new Workbook("FileName.xlsx");
Worksheet sheet = wb.Worksheets[0];
wb.Save("Path" + "FileName", SaveFormat.Xlsx);
You can take a look at this document as well and share your sample project and template file if issue still occurs.
1 Like