I converted the PDFs to Excels and now I am trying to extract the data from excel. When I try to open the workbook with Aspose.cells , its giving me an error “Input string was not in a correct format”
Tried to save as xls and as xlsx as well and same error. Trying to open in different methods yet having the same issue.
Opened this file manually and resaved it without any changes and it works both with Aspose fine.
Not sure if I a missing a step in conversion. Can you please suggest?
Code to convert PDF to xls:
Document pdfDocument = new Document(FileName);
Aspose.Pdf.ExcelSaveOptions excelsave = new ExcelSaveOptions();
excelsave.Format = ExcelSaveOptions.ExcelFormat.XLSX;
string outputExcelFileName = FileName.Replace(".pdf", “.xls”).Replace(FilePath, “”);
pdfDocument.Save(Extract.GetDataDir_ExcelOutput() + outputExcelFileName, excelsave);
Code to read excel:
Workbook Currworkbook = new Workbook(FileName);
Currworkbook.FileName = FileName;
Currworkbook.FileFormat = FileFormatType.Xlsx;
Worksheet Currsheet = Currworkbook.Worksheets[“Sheet4”];