We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error when I open a file xlsm

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

1 Reply

SR Sridhar Syncfusion Team February 12, 2013 05:12 AM UTC

Hi Cristiano,

Thank you for using Syncfusion products.

Could you please update us  with the excel file (.xlsm) which reproduces the above reported Xml exception so that we are able to proceed further on this.

Also, please upgrade to our latest version 10.4.0.71 as 8.1 version is 3 years old.

Later vesion link:
http://www.syncfusion.com/downloads/latest-version

Pleae let me know if you require any further clarifications.

Thanks,
Sridhar.S


Loader.
Live Chat Icon For mobile
Up arrow icon