Export to excel xlsx

Is it possible to export to excel in an xlsx format so I don’t get a formatting error every time I open the saved xls file? Currently using this script

table = event.source.parent.getComponent("main table")
 
filePath = system.dataset.exportExcel("data.xls", 1, table.data)
 
if filePath != None:
 
   system.net.openURL("file://"+filePath)

You would need to import a third party library to do this. I have spoken with some customers in the past that have used the xlsxwriter library. You can read more into it here

pypi.python.org/pypi/XlsxWriter

the script you are using should work fine, you just have the warning to contend with as you have already seen. The alternative would be using the system.dataset.exportCSV function. This is very similar to the script you already tried. You could then open the CSV in Excel without any warnings.