May 21 2021 08:35 AM
I would like to automate some functions in Power Query using VBA because users most likely will not know how to use Power Query to do the following. I already have some code where a user selects a folder path to some files. The code does more than this of course but utilizing the fact that the user has already selected the folder location, I want to use that data source toward the end of the process to open up Power Query. Then, do the equivalent of Selecting get data, Get Folder (this would be already declared). Where it would retrieve several .csv files. Now this may not be do-able but I would also like to utilize what functions I write in Power Query after those files have merged and run those set of instructions on the files before Closing & Loading into the Workbook.
May 25 2021 08:05 AM
May 25 2021 08:58 AM
@Jan Karel Pieterse Sorry, I did not mention that this process would be used as a first time setup for other users. Not every user knows how to use Get & Transform (Power Query sounds so much better), so, it would just be something to initially gather the data and set the PQ up. I did find some information here https://excelunplugged.com/2018/01/23/modifying-power-query-m-code-with-vba/ that I have not tried yet but hope it will work for what I am doing. I will follow up and update here if it does or does not work.