Importing XML into excel : semicolon character was expected

Nyanko

Active Member
Joined
Sep 1, 2005
Messages
437
Hi,

I'm trying to import an XML file into excel to format for a colleague unfortunately excel is unable to open the file stating :

XML Parse Error
Reason : A semi colon character was expected
Line : 313
Column : 94
File Offset : 13226

This XML file is generated each month via google analytics so will re generate this problem every time. I'm only looking to extract and format the text of the file so hoped there was a way I can do this.

Is there a way to do this via excel or can I use excel to open the file via notepad and then copy the text ?

Any advise or suggestions would be appreciated as I've never worked with XML before and am not sure where to start !
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Just to finish on this subject I used the following code to capture the file and re-name it to an xls file on the fly :

Code:
Sub ImportXML()
        'Open a dialogue box to find the file to import
    ChDrive "C:\"
    WkbImportFile = Application.GetOpenFilename(Title:="Please choose an XML file to import")

    WkbTXTImportFile = Left(WkbImportFile, Len(WkbImportFile) - 3)
    WkbTXTImportFile = WkbTXTImportFile & "xls"
    
    Name WkbImportFile As WkbTXTImportFile
        Workbooks.Open Filename:=WkbTXTImportFile
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top