Free Support Forum - aspose.com

Use Workbook.Save method instead

I have the following code:

Dim wb As Aspose.Cells.Workbook = New Aspose.Cells.Workbook
Dim sheet As Worksheet = wb.Worksheets(0)
sheet.Cells.ImportDataTable(dt, True, 2, 0)
sheet.Name = "My Sheet Name"
sheet.AutoFitColumns()
wb.Save(path & f, FileFormatType.Excel97To2003)

Why does the last line have the error "Public Sub Save is obsolete: Use Workbook.Save method instead."

It sure looks like I am using the Workbook.Save method.

I got it.

It is the parameter: SaveFormat instead of FileFormatType

wb.Save(path & f, SaveFormat.Excel97To2003)

Hi,

Good to know that you got it right. You can also see the document for Saving Excel files for your complete reference now:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/saving-files.html


Thank you.