Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application, both ASP.NET web sites and Windows Forms application.

Tue Dec 13, 2011 1:12 pm

Hello,
I want to load an XML file and save it as xlsx. Can you help me, it does not work!
[list=]
sPath = g_sExport & "\" & Me.Name & ".XML"
sFinal = g_sExport & "\" & Me.Name & ".Xlsx"
Dim workbook As Workbook = New Workbook()
workbook.LoadFromXml(sPath)
workbook.SaveToFile(sFinal, ExcelVersion.Version2007)
[/list]

Thank you in advance,
greetings
Muller Guy

gmuller@vonet.ch
 
Posts: 8
Joined: Wed Mar 23, 2011 10:58 am

Wed Dec 14, 2011 6:54 am

Hello gmuller,

Thank you for your inquiry.

Please try the following code to achieve your functionality.
Code: Select all
           Workbook workbook = new Workbook();

            //Initailize worksheet
            using (FileStream fileStream = File.OpenRead(@"..\..\ReadXMLSample.Xml"))
            {
                workbook.LoadFromXml(fileStream);
            }

            workbook.SaveToFile(@"..\..\Test.xlsx", ExcelVersion.Version2010);
            System.Diagnostics.Process.Start(@"..\..\Test.xlsx");



If you still have any other questions, please don't hesitate to contact us.
Have a nice day.
Tina
Technical Support/Developer,
e-iceblue Support Team
User avatar

Tina.Lin
 
Posts: 152
Joined: Tue Sep 13, 2011 5:37 am

Thu Feb 01, 2018 2:00 pm

Hi,

I have downloaded free trial version to test LoadFromXml file in Spire.Xls.

It says LoadFromXml doesn't exist in current dll. exe is spire.xls-fe_7.9

lovesha
 
Posts: 1
Joined: Thu Feb 01, 2018 1:50 pm

Fri Feb 02, 2018 3:27 am

Dear lovesha,

Thanks for your inquiry.
Free Spire.XLS for .NET Version:7.9 has the method LoadFromXml, please make sure you are using correct version, and below is dlls information for checking.
Spire.Common.dll V1.2.366.55040
Spire.License.dll V1.3.5.40
Spire.XLS.dll V7.9.0.5504
Spire.Pdf.dll V3.6.230.55040

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 2732
Joined: Tue Sep 06, 2016 8:30 am

Mon Feb 05, 2018 8:49 am

Dear lovesha,

Greetings from E-iceblue.
Has your issue been resolved ? Could you please give us some feedback at your convenience ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 2732
Joined: Tue Sep 06, 2016 8:30 am

Thu May 16, 2019 3:21 am

Hi,

I want to convert XML to Excel and when I was trying to use the code which you provided over here, got a below error at LoadFromXMl

sprᡲ: 'Error occured when parse : strict. Detailed: Invalid file format.'

When the same is used for drag and drop in excel, it's working.

Please suggest me to resolve the issue.

Durgaraman
 
Posts: 1
Joined: Thu May 16, 2019 3:08 am

Thu May 16, 2019 3:41 am

Hello Durgaraman,

Thank you for contacting.
After an initial test with our latest Spire.XLS Pack(Hotfix) Version:9.5.4, I didn't reproduce your issue. Thus, I suggest that you download the latest version and try again. If the error still occurs after trying, please share us with your input Xml file to help further look into your issue. You could send it to us via email (support@e-iceblue.com).

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 946
Joined: Wed Apr 25, 2018 3:20 am

Fri May 24, 2019 9:17 am

Hello Durgaraman,

Greetings from E-iceblue.
Could you please let us know how is the issue going? Thanks in advance for your valuable feedback and time.

Sincerely,
Lisa
E-icbelue support team
User avatar

Lisa.Li
 
Posts: 946
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.XLS