I used power query to combine data from multiple sheets in multiple excel workbooks all within the same folder. I have a cell which i named Path that has the path to the folder. The query runs successfully and does what it's supposed to do. I however want to create a macro that can be used to assign to a clickable button to update the query easily. I keep getting a "Object variable or With block variable not set" error when i try to run the macro though. Please note that I don't really have much experience with VBA. Also If there is a way to assign a command to a button to update the query then that would be great.
The power query code is
let
Path = Excel.CurrentWorkbook() {[Name="Path"]}[Content]{0}[Column1],
Source = Folder.Files(Path)
in Source
The power query code is
let
Path = Excel.CurrentWorkbook() {[Name="Path"]}[Content]{0}[Column1],
Source = Folder.Files(Path)
in Source