Aspose cells workBook method difference

Hi Aspose Team

Difference between these two workBook constructor methods

workbook = new Workbook(filePath);

Workbook w = new Workbook(filePath,LoadOptions);

Will it change read behavior or anything ?
Thanks in Advance

@hruser,

Apparently no difference whether using first line or second line. However in some cases, second line would only work:
i) The extension of the file is not matched to its original format. The extension of the file is different while its underlying file format is other. For example, a CSV or text format is saved with an extension, e.g. .xls or xlsx. In this case, you got to instantiate LoadOptions to specify its LoadFormat.

ii) Sometimes you need to set specific attributes while loading the file via Aspose.Cells object model. To set these attributes you got to instantiate LoadOptions object and then set those attributes.

1 Like

Hi @Amjad_Sahi

Thank you for the explanation.

@hruser,

You are welcome.