helpneeded2
Board Regular
- Joined
- Jun 25, 2021
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
I have created a query similar to that of one described in this video:
The summary of this is:
If I remove this line of code above, then I can relaunch the query with the Macro button, and then I right click on the returned table on my DATA sheet and select "refresh" which will open up a "Native Database Query" window, in which I select "Run" , and it will refresh with the new data.
In the video, the host just clicks the Macro button, which will then bring up the "Native Database Query" window, which will then allow the user to select "Run" and complete the operation.
Can anyone think of a reason why my process will not work as intended with the VBA Refresh code? (Or more importantly, can anyone advise what I can do to make it work correctly.)
The summary of this is:
- I have a field that contains a list of numbers that will be passed to a SQL query: (1), (23), (3003)
- I have a macro that runs a query I have saved as Power BI query.
- The result is output onto the DATA tab of my worksheet.
- The macro is executed by pressing a button.
Code:
ActiveWorkbook.Queries("GetDataQuery").Refresh
If I remove this line of code above, then I can relaunch the query with the Macro button, and then I right click on the returned table on my DATA sheet and select "refresh" which will open up a "Native Database Query" window, in which I select "Run" , and it will refresh with the new data.
In the video, the host just clicks the Macro button, which will then bring up the "Native Database Query" window, which will then allow the user to select "Run" and complete the operation.
Can anyone think of a reason why my process will not work as intended with the VBA Refresh code? (Or more importantly, can anyone advise what I can do to make it work correctly.)