Sunday, 2 November 2014

Open XML File in same workbook as Macro



I am writing a macro which will import some XML data and then do some clever things with it. The following code opens the XML but as a new workbook - can anyone advise how to open it into the current workbook?



Dim fNameAndPath As Variant

fNameAndPath = Application.GetOpenFilename(FileFilter:="XML Files (*.xml), *.xml", Title:="Select File To Be Opened")
If fNameAndPath = False Then Exit Sub
Workbooks.Open Filename:=fNameAndPath


Cheers


No comments:

Post a Comment