Hello,
I tried to import the data from a datatable using a formatted xlsx file (designerFile - having set borders and colors for cells), but the format settings are lost after saving the file.
If using a xls file, it works just fine.
Here is the code I use:
Dim fstream As System.IO.FileStream
fstream = New System.IO.FileStream(designerFile, IO.FileMode.Open)
workbook.Open(fstream, FileFormatType.Excel2007Xlsx)
fstream.Dispose()
Dim worksheet1 As Worksheet = workbook.Worksheets(0)
worksheet1.Cells.ImportDataTable(dataTable, False, 1, 0, True)
workbook.Save(fileName, FileFormatType.Excel2007Xlsx)
I am using Aspose.Cells version 4.8.2.0.
Thank you very much!
Dariana