Opening a Tab Delimited File with Aspose

Hi,

We own licenses to Aspose Cells and Total.

I have a tab delimited text file. I can change it's extension to xls, and then open it in excel. However, when I try to open it programmatically with Aspose, I get the following exception: "This file's format is not supported or you don't specify a correct format."

I am using the following code to open the file, and the exception occurs on the final line.

Dim lo = New LoadOptions()
Dim ldo = New LoadDataOption()
ldo.SheetIndexes = New Integer() {0}
ldo.ImportFormula = False
lo.LoadDataOnly = True
lo.LoadDataOptions = ldo
Dim workbook = New Workbook(filePath, lo)

I would appreciate any help you can give.

Thanks

Daniel

Hi,

Please try this code and let us know your results.


'Instantiate LoadOptions specified by the LoadFormat.

Dim loadOptions As New LoadOptions(LoadFormat.TabDelimited)


'Create a Workbook object and opening the file from its path

Dim wb As New Workbook(“e:\test\Book1.txt”, loadOptions)