![]() I started of by using the code that was created in a macro - but realized now that the with - end with block is not used on repeat imports anyway or rather has no use. SRange = "$A$" & (Cells(Rows.Count, "A").End(xlUp).Row + 1)ĪctiveWorkbook.XmlImport URL:=sXMLFile, ImportMap:=Nothing, Overwrite:=Not bolAppend, Destination:=Range(sRange) ShowImportExportValidationErrors = False In the Get & Transform group, click on the ' Get data' option. Open the Excel file where you want to import the data. Now, the xml files that the machines generate will always have a new filename as it names the files with the date & time the file was generated - in the format 'machineID yyyymmddhhmmss. You can connect the power query to the URL, extract the XML data, and import that data into Excel. With ActiveWorkbook.XmlMaps(sWorksheet & "_Map") Part of the macro (which i already have) will then copy certain cells from Sheet1 & put them into their respective worksheet (2-4). Warning = MsgBox("Warning! The worksheet " & sWorksheet & " will be deleted and all data therein lost. Do you want to append the data to the existing sheet?", vbYesNoCancel) Response = MsgBox("Worksheet already exist. MySheetNameTest = Worksheets(sWorksheet).Name ![]() This is what I got so far: Sub ImportXML(sWorksheet, sXMLFile, bolAppend)ĭim mySheetNameTest, Response, Warning, sRange I'm not even able to do such an import "manually" though either - importing XML and have a new table created and then importing another XML with the same format (different date) into the same table. I am able to import the data onto the same sheet, however each import results in a separate table. ![]() I'm trying to solve the same problem and have tried various approaches playing around with the different XMLImport parameters, but no success. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |