I have Power Query queries in an Excel 2010 file and would like to delete these queries using VBA. so far I can achieve that manually with the following steps:
- unload Power Query addin
- run Document Inspector and click to delete Custom XML data
The Macro recorder record the following code for step 2.
Sub Makro1()
'
' Makro1 Makro
'
'
ActiveWorkbook.RemoveDocumentInformation (xlRDIPrinterPath)
ActiveWorkbook.RemoveDocumentInformation (xlRDIDocumentProperties)
ActiveWorkbook.RemoveDocumentInformation (xlRDIInactiveDataConnections)
End Sub
However, using this macro I do not achieve the same result (=PQ query code gone from the workbook).
Any ideas on how to achieve the PQ query codes to be removed using VBA?