Excle,aspose.cells Formula field value does not take xmls to XML

Source: Internet
Author: User

Problem:

One, the cell or column is a formula, the readout value is 0

Aspose.cells 4.4.0.5 version because it is too low to read the xmls suffix of the Excel file, it is found that if this column is calculated by the formula, the value is not obtained. The value obtained is always 0

Second, the upgrade can solve the problem. But there will be problems like

1, style use change big

If you upgrade aspose, this issue can be resolved. But there are a lot of places to make changes.

2, go to PDF printing has a problem

If you have a good excle-to-pdf aspose generated, print it. There will be broken pages, line adaptive method, the excle display is normal, but printed out after the display is not complete.

I tried it. 7.2.1.0 version 5.3.1.0 version, the higher the version, the more problematic the printing.

Three, solve.

Just use the Microsoft.Office.Interop.Excel.dll 12.0 version on the line. This thing has been added in the reference. Net. Then use my code below to turn xmls into XML. The original thing doesn't have to change

/// <summary>        ///Convert Excel format/// </summary>        /// <param name= "Strsavepath" >Original Path</param>        /// <returns>New Path</returns>         Public Static stringConvertexcel (stringStrsavepath) {            stringstrpath =string.            Empty; //convert an XML file to a standard Excel formatObject nothing = System.Reflection.Missing.Value;//because many values of yongcom components need to be replaced with Missing.ValueExcel.Application Exclapp =NewExcel.applicationclass ();//InitializeExcel.Workbook Excldoc = ExclApp.Workbooks.Open (Strsavepath, nothing, nothing, nothing Nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing);//Open the excl working thinFileInfo Exportfile =NewFileInfo (Strsavepath); if(ExportFile.Extension.Equals (". xlsx", StringComparison.OrdinalIgnoreCase)) {strpath= ExportFile.FullName.Replace (Exportfile.extension,". xls"); if(File.exists (strpath)) {file.delete (strpath); }            }            Try{Object format= Excel.XlFileFormat.xlWorkbookNormal;//Get excl 2007 file format this is not a tube, use this, for others may not. Exclapp.displayalerts =false; Excldoc.saveas (strpath, format, nothing, nothing, nothing, nothing, Excel.XlSaveAsAccessMode.xlExclusive, nothing, Nothing, nothing, nothing, nothing);//Save As Excl 2007 format            }            Catch(Exception ex) {} excldoc.close (Nothing, nothing, nothing);            Exclapp.quit (); returnstrpath; }
Convert Excel format


Excle,aspose.cells Formula field value does not take xmls to XML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.