Hi,
While importing one of my xlsm file into GridWeb I am getting exception “Not a legal OleAut date.”.
But I don’t see any date Cell in the Sheet.
How to resolve such kind of errors which stops loading of excel file to Gridweb?
Regards
Virendra
Hi,
virendra.ray:
While importing one of my xlsm file into GridWeb I am getting exception "Not a legal OleAut date.".
But I don't see any date Cell in the Sheet.
How to resolve such kind of errors which stops loading of excel file to Gridweb?
Please attach your template file here, we will check your issue soon.
Thank you.
Hi,
I am afraid currently Aspose.Cells.GridWeb control only supports to read/write XLS, XLSX/XLSM, and CSV formats into its grid/matrix. I have logged a ticket with an id: “CELLSNET-41205” for your feature request. We may look into it in future versions though.
As a workaround, you may try to use Aspose.Cells library that does support to read/write or manipulate HTML files if it could fit your needs.
Thank you.
Hi,
I am saving attached excel as HTML using Aspose.Cells.Workbook.
But the desired output is not similar to what I get using Excel saveAs option.
I have also attached zip file containing the 2 html files for your reference.
What option we can apply in Aspose to get exactly similar output as given by excel, but preserving formula information as Apsose conversion does.
Also at the cell where a Formula exists, its data value is missing in html file.
Regards
Virendra
Hi,
I have saved few of my HTML files as .xls and when I open these files using Microsoft excel, it gives me a warning but I m able to see my excel file and I can edit and save it as normal .xls file.
But using Aspose.Cells.WorkBook in same scenario is giving me error. It is not loading the .xls file.
How to open this .xls file (saved from HTML) in Aspose Workbook?
Is there any method I can force workbook to load the file having .xls file, irrespective of warnings?
Regards
Virendra
Hi,
Please attach your template files (i.e…, input html file and output XLS file (by Aspose.Cells) which you could not load/open by Aspose.Cells.Workbook object). Also paste your sample codes here. We will check your issue soon.
Thank you.
Hi,
html and .xls files are in zip file attached.
I have saved html file using following code
StreamWriter file;
StreamReader rd = new StreamReader(str_tempHTMLPath);
input = rd.ReadToEnd();
formatHTMLTable();
file = new StreamWriter(str_tempxlsfile);
file.Write(input);
file.Close();
rd.Close();
Now I want to open this .xls file using Workbook
Workbook workbook = new Workbook(rd);
workbook.Save(str_tempxlsfile, SaveFormat.Excel97To2003);
But I am getting exception at Workbook workbook = new Workbook(rd);
Regards
Virendra
Hi,
I tried opening your so called XLS file and found errors in MS Excel too, so your file is not a standard XLS file that MS Excel supports for doing your way. We follow MS Excel standards, so you may get the error opening such a file via Aspose.Cells APIs.
I am not entirely sure about the process you are using? Are you taking your attached HTML file into the streams and then create a new file (you are trying to create a new XLS file but this might not the correct way) first and then write the html data/contents to it. Now you are using Aspose.Cells.Workbook object to open/load the file.
Here is the sample (runnable) code that I tried:
Sample code:
StreamWriter file;
StreamReader rd = new StreamReader(“e:\test2\veerugr.html”);
string input = rd.ReadToEnd();
//formatHTMLTable(); – Not sure about this method either.
file = new StreamWriter(“e:\test2\Veeru.xls”); // This line will not create a native Excel file, so its format would be unknown. MS Excel will give error opening into it.
file.Write(input);
file.Close();
rd.Close();
Workbook workbook = new Workbook(“e:\test2\Veeru.xls”); //Got error: This file’s format is not supported or you don’t specify a correct format.
workbook.Save(“e:\test2\vout2.xls”, SaveFormat.Excel97To2003);
Hi,
Is there any way I can achieve this?
HTML to Excel and open the excel in Workbook.
Please guide through some work around.
Regards
Virendra Kumar
Hi,
Thanks for your posting and using Aspose.Cells.
Aspose.Cells can convert Html file into Ms-Excel file, how it cannot deal with all types of html all the time.
It mostly deals successfully with the Ms-Excel generated html. For example, if you save your workbook into html format using Ms-Excel, then load it back using Aspose.Cells , then Aspose.Cells will not complain anything and load your html file into a workbook object.
Once, you got the Workbook object, you can then save it back in many formats e.g html, pdf, xls, xlsx or xlsm
For more information, please see the following articles for your reference.
Hi,
I am using following code to save XLS file as html using aspose
FileStream fs = File.OpenRead(str_outputFilexls);
Aspose.Cells.License lc = new Aspose.Cells.License();
lc.SetLicense(@“C:\Program Files (x86)\Aspose\Aspose.Cells for .NET\Demos\C Sharp\Web\Aspose.Cells.GridWeb\aspose\Aspose.Total.lic”);
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(fs);
///wb.Worksheets.Add();
wb.Save(str_outputFilehtml, SaveFormat.Html);
wb = null;
fs.Close();
But cells which contains formula are not having any value in HTML file.
Also if the column width is not proper in excel, html contains ########## as value.
I am also having problems with values which are not wrapped.
Please provide the solution.
Regards
Virendra
Hi,
virendra.ray: FileStream fs = File.OpenRead(str_outputFilexls);
Please attach your template Excel file, so that we could check your issue properly.
By the way for your issues:
virendra.ray: But cells which contains formula are not having any value in HTML file.
Please try calling Workbook.calculateFormula() before saving the HTML file, if it works fine.
virendra.ray: Also if the column width is not proper in excel, html contains ########## as value.
I am also having problems with values which are not wrapped.
You may try to call Worksheet.autoFitColumn method accordingly, see the document for reference:
It should be same as MS Excel, please check the Excel file into MS Excel. If you still find the wrapping text issue or other issue, let us know with your input and output file (by Aspose.Cells) here. We will check it soon.
Thank you.
File is attached for your reference
Thanks
Virendra
virendra.ray:
File is attached for your reference
Thanks
Virendra
Hi,
I was able to notice your issue but we need to investigate this issue further.
Please provide us your complete runnable project so that we could look into it further and log it in our database for a fix.
Also, I found, Aspose.Cells can load your file and then when I save it back it saves the workbook fine and the saved workbook can then be opened in Ms-Excel 2010 fine.
However, it loses your fill formatting. I have attached the output file and screenshot for your reference.
C#
string filePath = @"F:\Shak-Data-RW\Downloads\Export.xls";
Workbook workbook = new Workbook(filePath);
workbook.Save(filePath + ".out.xls", SaveFormat.Excel97To2003);
Screenshot:
I want to retain the formatting along with the data.
How can I achieve this?
Regards
Virendra
Hi,
Thanks for your posting and using Aspose.Cells.
I have logged a ticket against your mentioned issue with the id: CELLSNET-41234.
We will look into this issue and try to fix it. However, you should provide a simple sample project replicating your issue with the latest version: Aspose.Cells
for .NET v7.3.4.2.
It will help us look into your issue more precisely and we will be able to fix it quickly.
Hi,
The issue about formatting is fixed in the latest aspose version 7.3.4.3.
However, the template file (Export.xls ) is not a standard Ms-Excel generated html. We could not parsed it so perfect now.
Please download and try this fix: Aspose.Cells for .NET v7.3.4.3 and let us know your feedback.