Free Support Forum - aspose.com

Error saving to FileFormatType.Excel2007Xlsx

Using 4.9.0 Net2.0 DLL with Mono C# compiler version 2.6.1.0 on OS X Snow Leopard.


I took an old program that was working fine and changed this line:

workbook.Save(pathToXlsFile, FileFormatType.Excel97To2003);

to this:

workbook.Save(pathToXlsFile, FileFormatType.Excel2007Xlsx);

And now I’m getting this:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at System.Xml.XmlTextWriter.WriteEndAttribute () [0x00000] in :0
at System.Xml.XmlWriter.WriteAttributeString (System.String prefix, System.String localName, System.String ns, System.String value) [0x00000] in :0
at xabb58b8f2887ff8e.x988f58df59ed8022.x62728b4e63ac7b93 (System.Xml.XmlTextWriter xbdfb620b7167944b, System.Collections.ArrayList x5c1350dd03334070) [0x00000] in :0
at xabb58b8f2887ff8e.x988f58df59ed8022.x7588f8341ef4cb69 (xabb58b8f2887ff8e.x66d04cb1f66d7474 x190fb0224bf6e6eb, System.Xml.XmlTextWriter xbdfb620b7167944b) [0x00000] in :0
at xabb58b8f2887ff8e.xb440dd60010e3cc4.x7588f8341ef4cb69 () [0x00000] in :0
at xabb58b8f2887ff8e.xb440dd60010e3cc4.x6210059f049f0d48 () [0x00000] in :0
at xabb58b8f2887ff8e.xd6253a84180865bd.xd2a2164b3fc4b3aa (Aspose.Cells.Workbook xce16031e3118b903, System.IO.Stream xcf18e5243f8d5fd3, FileFormatType x482c55f56771fee8) [0x00000] in :0
at Aspose.Cells.Workbook.Save (System.IO.Stream stream, FileFormatType fileFormatType) [0x00000] in :0
at Aspose.Cells.Workbook.Save (System.String fileName, FileFormatType fileFormatType) [0x00000] in :0
at Report.Main (System.String[] args) [0x00000] in :0

Hi,

Please share your template file here. We will check it and get back to you soon.

Thank You & Best Regards,

There is no template file; I’m creating the document in code:


static public void Main (string[] args) {
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(“Aspose.Cells.lic.xml”);
Workbook workbook = new Workbook();
Worksheets worksheets = workbook.Worksheets;
worksheets.Add();
Worksheet sheet2 = worksheets[1];
Cells cells = sheet2.Cells;

I stripped the program down to doing nothing but creating an empty file and get the same error:


using System;
using System.IO;
using Aspose.Cells;
class Report {
static public void Main (string[] args) {
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(“Aspose.Cells.lic.xml”);
Workbook workbook = new Workbook();
Worksheets worksheets = workbook.Worksheets;
worksheets.Add();
Worksheet sheet2 = worksheets[1];
Cells cells = sheet2.Cells;
String pathToXlsFile = args[0] + “.xls”;
// workbook.Save(pathToXlsFile, FileFormatType.Excel97To2003);
workbook.Save(pathToXlsFile, FileFormatType.Excel2007Xlsx);
}
}

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the details about the system environment and sample code.

Your issue has been added to our internal issue tracking system with issue id CELLSNET-15885. We will check your issue by creating similar environment as your system and get back to you soon.

Thank You & Best Regards,

Any news on this issue? Thanks.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We are looking into the msi installer issue and will update you as soon as we figure it out. Meanwhile, please download and try the latest version of Aspose.Cells (dll only) from the following location.

http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry232019.aspx

Thank You & Best Regards,

> We are looking into the msi installer issue

I didn't use the MSI installer; I used the DLL package. I'm using OSX; I can't run MSI files.

> please download and try the latest version of Aspose.Cells (dll only)

That's the package I used.

This is obviously not an MSI installation issue since I didn't use the MSI package.

Hi,

We will get back to you soon regarding your issue.

Thank You & Best Regards,

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have found the issue you mentioned. We are working on it and hopefully we will provide a fix before the end of this week.


Thank You & Best Regards,

Hi,

We have fixed the issue you mentioned for your environment. Please try the attached version and let us know if it fixes the issue.


Thank you

this works, thanks.

The issues you have found earlier (filed as 15885) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.