当我尝试创建从Office365环境中生成的excel文件(.xlsb格式)的实例时,它抛出错误。
string fileName = "Subhajit_test.xlsb";
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(fileName);上面的代码抛出了以下错误:
Invalid workbook setting in the xlsb workbook.
at .?.??()
at .?.Read( , ?? )
at ..Read()
at ..Read(Workbook , LoadOptions )
at Aspose.Cells.Workbook.?(Stream , LoadOptions , Boolean )
at Aspose.Cells.Workbook.?(String , LoadOptions )
at Aspose.Cells.Workbook..ctor(String file)
at ASPOSE.GetDataFromExcel..ctor(String fileName)
```[enter image description here][1]发布于 2019-05-07 22:20:23
//Instantiate a workbook.
Workbook workbook = new Workbook();
//Get the first (default) worksheet.
Worksheet sheet = workbook.Worksheets[0];
//Get the cells in the sheet.
Cells cells = sheet.Cells;
//Merging two cells (B5:C5)into a single cell(B5).
cells.Merge(4,1,1,2);
//Put some value into the merged cell.
cells["B5"].PutValue("Hello World!");
//Align the text as Center aligned.
cells["B5"].Style.HorizontalAlignment = TextAlignmentType.Center;
//Save the file.
workbook.Save("d:\\test\\test_book.xls");有关更多参考,请查看不同的wiki主题以满足您的需求:http://www.aspose.com/Wiki/Default.aspx/Aspose.Cells/
发布于 2019-06-04 23:31:05
我尝试在创建.xlsb文件的实例时重现这个问题,它似乎在最新的Aspose.Cells版本19.5上工作得很好。
在v19.2中,有关保存和打开.xlsb文件的一些问题已修复,因此我建议您升级到并尝试最新版本。
如果您仍然有任何问题,请提供我一个可运行的示例代码和模板.xlsb文件,我将检查您的问题,并尝试帮助。
如果有问题,你也可以在https://forum.aspose.com/上发布。
注:我是Aspose的开发者布道师。
https://stackoverflow.com/questions/56023417
复制相似问题