#25 How to Parse XML Files with VBA Introduction
Sub ReadBookDetailsFromXML() Dim xmlDoc As Object Dim xmlNode As Object Dim i As Integer ' Create a new XML Document object Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0") ' Configure properties xmlDoc.async = False xmlDoc.validateOnParse = False ' Load the XML file If Not xmlDoc.Load("C:\XML Files\books.xml") Then MsgBox "Failed to load XML file. Exiting." Exit Sub End If i = 2 For Each xmlNode In xmlDoc.DocumentElement.ChildNodes Sheet2.Cells(i, 1).Value = xmlNode.getAttribute("id") Sheet2.Cells(i, 2).Value = xmlNode.getElementsByTagName("author")(0).Text Sheet2.Cells(i, 3).Value = xmlNode.getElementsByTagName("title")(0).Text Sheet2.Cells(i, 4).Value = xmlNode.getElementsByTagName("genre")(0).Text Sheet2.Cells(i, 5).Value = xmlNode.getElementsByTagName("price")(0).Text Sheet2.Cells(i, 6).Value = xmlNode.getElementsByTagName("publish_date")(0).Text Sheet2.Cells(i, 7).Value = xmlNode.getElementsByTagName("description")(0).Text i = i + 1 Next xmlNode ' Release the XML Document object Set xmlDoc = Nothing End Sub Sub ReadUniversityDetailsFromXML() Dim xmlDoc As Object Dim xmlFaculty As Object Dim xmlProfessor As Object Dim i As Integer ' Create a new XML Document object Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0") ' Configure properties xmlDoc.async = False xmlDoc.validateOnParse = False ' Load the XML file If Not xmlDoc.Load("C:\XML Files\university.xml") Then MsgBox "Failed to load XML file. Exiting." Exit Sub End If i = 2 'Loop through each faculty For Each xmlFaculty In xmlDoc.DocumentElement.ChildNodes 'Loop through each professor For Each xmlProfessor In xmlFaculty.ChildNodes Sheets("Sheet3").Cells(i, 1).Value = xmlDoc.DocumentElement.getAttribute("name") ' University name Sheets("Sheet3").Cells(i, 2).Value = xmlFaculty.getAttribute("name") ' Faculty name Sheets("Sheet3").Cells(i, 3).Value = xmlProfessor.getAttribute("id") ' Professor ID Sheets("Sheet3").Cells(i, 4).Value = xmlProfessor.getElementsByTagName("name")(0).Text ' Professor name Sheets("Sheet3").Cells(i, 5).Value = xmlProfessor.getElementsByTagName("subject")(0).Text ' Professor subject i = i + 1 Next xmlProfessor Next xmlFaculty Set xmlDoc = Nothing End Sub

#26 How to Automate Google Searches with VBA in Excel Using IE and Chrome

The Easiest Way to Scrape Web Data with VBA

Convert Excel To XML | XML To Excel | excel import export

How to convert Excel Data on to XML file

Excel VBA Introduction Part 22 - Files and Folders (FileSystemObjects)

BISTEC Hearts Academy | DevOps Engineer | Month 6 | CI/CD End-to-End (Capstone)

You Don't Need VLOOKUP & XLOOKUP, You Need This | Excel

Introduction to Xml Data Parsing in Java | How to parse the data from given xml in Java

How to Import Emails From OUTLOOK to EXCEL & why you want to do that!

PDF to Excel Converter

God Says:"MY CHILD, I NEED TO SEE YOU URGENTLY!"/God Message Now/God Message

Unbelievable Smart Worker & Hilarious Fails | Construction Compilation #5 #adamrose #smartworkers

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

Excel VBA Introduction Part 47.3 - Internet Explorer vs XML HTTP Request

Loop Through All Files in a Folder Using VBA/Macros in Excel

Boho Art Screensaver | Turn Your TV Into Wall Art | Art Slideshow For TV | 1 Hr | No Sound

😱 Don’t Throw Away Old Phones! Put One Behind Your WiFi Router and Watch What Happens!

Billionaire's WARNING: I'm SELLING. The Crash Is Already Here!
![[2024] Microsoft Excel 2019 | How to Import XML Data](https://i.ytimg.com/vi/IgK7a9hA18k/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLAQJTNFxz5VWJ1kPKVO6al66vfUsA)
[2024] Microsoft Excel 2019 | How to Import XML Data

