exportExcel file format and extension don't match

I am using the exportExcel function and it works fine, however when I try to open the Excel file I get the following.

File format and extension of ‘Filename’ don’t match. The file could be corrupted etc…

I have tried a suggested name with extension .xlsx and xls and no extension with all ending in the same result. Does anyone know what format ignition is writing the file as? Is there a way to work around this? I’m using ignition 7.8.5

1 Like

It’s an xml file That Excel can read into a worksheet.

Not as such, but you can take a look at this post:

1 Like

We are looking to finally get proper exporting to “real” XLSX files working - hopefully pretty soon.

1 Like

Thanks. I ended up using the dataSetToExcel instead of the exportExcel function which gives the same error but actually opens the excel file. How do I add the Tag suggested in the post? I get a no viable input ? when I try to add it to the beginning of the filename.

TableData = event.source.parent.getComponent(‘tblSerials’).data

#data = system.dataset.toDataSet(TableData)

filePath = system.dataset.dataSetToExcel(1,[TableData])
filename = system.file.saveFile(“LogEvents_”+event.source.parent.getComponent(‘TxtField_Serial Number’).text+".xls")

if filename != None:
system.file.writeFile(<?mso-application progid="Excel.Sheet"?>+filename, filePath)

Has this issue been resolved?

I believe the last bug fixes were as of 8.0.10.

1 Like