Hi, I wanted to see if there is a way to convert XML files in a folder to the Excel files using Power Automate desktop. I see there is a way to iterate over files in a folder and read XML. What I seem to be missing is a way to convert XML to Excel/ write XML data to Excel. Any ideas?
Thanks
if WScript.Arguments.Count < 2 Then
WScript.Echo "Please specify the source and the destination files. Usage: EXCELtoCSV <xls/xlsx source file> <csv destination file>"
Wscript.Quit
End If
csv_format = 6
Set objFSO = CreateObject("Scripting.FileSystemObject")
src_file = objFSO.GetAbsolutePathName(Wscript.Arguments.Item(0))
dest_file = objFSO.GetAbsolutePathName(WScript.Arguments.Item(1))
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(src_file)
oBook.SaveAs dest_file, csv_format
oBook.Close False
oExcel.Quit
Important to note that wherever you are performing the conversion (DOS working folder, you place the .xml file there for conversion. Also, you need to ensure the .VBS file you created is also located in that folder. I only used "Desktop" as an example. I usually run this in my c:\foldername
Hope this helps someone one day.
You'll need to read the XML file, store its values into variables and then write those variables to an Excel file. Also, I'm assuming all your XML files have basically the same structure and you want the same output structure (same columns in Excel). Basically, you'll need to perform the following steps:
This is a very high level generalization to guide you to the desired outcome.
Didi you try importing a xml to Excel?
1) Get the full path + name of XML file
2) Lauch Excel with a blank sheet
3) Navigate with UI elements to 'Developer' tab, then 'Import' under 'XML' group. In the select file window, use 'Populate text field in window' to fill the path&name of xml file captured in step 1 and click Import.
4) 'Save Excel' as xlsx file
Previously you have to show Developer tab in Excel (Show the Developer tab (microsoft.com))
eetuRobo
18
Super User 2025 Season 1
Nived_Nambiar
10
Super User 2025 Season 1
stampcoin
6