Hi, I'm trying to open and read an Excel 2007 file (xlsm), but the following code return the System.Xml.XmlException: 'o:relid' is a duplicate attribute name. Line 33, position 26 (attached the stack trace for more details):
Dim excelengine As ExcelEngine = New ExcelEngine
Dim application As IApplication = excelengine.Excel
application.DefaultVersion = ExcelVersion.Excel2007
Dim xlsfile As String = fname
Dim filename As String = Server.MapPath("Upload") & "\" & userhostaddr & "\" & xlsfile & "file.xlsm"
Dim workbook As IWorkbook = application.Workbooks.Open(filename, ExcelParseOptions.DoNotParseCharts, False, String.Empty, ExcelVersion.Excel2007)
The file is an Excel 2007 file with macro, structured reference formulas and image.
I use VisualStudio 2008 Framework 3.5
I referenced:
Syncfusion.XLsIO.Base 8.103.0.30
Syncfusion.Core 8.103.0.30
Syncfusion.Compression.Base 8.102.0.30
Syncfusion.DLS.Base 8.103.0.30
Syncfusion.Shared.Base 8.103.0.30
Syncfusion.Shared.Web 8.103.0.30
I tried to open and edit the xls file then save it in xlsm with Syncfusion (workbook.saveAs) but Ms Excel is not able to open it.
Then, I trid to open xlsm file with ExcelOpenType.Automatic but I get the same System.Xml.XmlException error message
Finally, I tried to convert the file to xlsb but is not supported.
Syncfusion is possible to open and edit the file xlsm, as I need? Otherwise there are warkaround?
Thank you very much for your help.
Regards
ErrorOpenXlsm_StackTrace_f07ab18c.rar