Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
How to connect VBA code in Data Query
Please give an exampe
Thank you
Theoretically, this is possible, but there is a problem: when the power query plug-in is started, VBA will be blocked or unable to execute commands (especially in the same instance and the same file).
Possible implementation method: Use VBA to build a network service, Power Query sends a request to it (using Web.Contents), and the service performs operations based on the request content (but may be blocked or unable to execute commands).
Hi @ANDRII_SAV1971 ,
As they say, you can't go calling vba operations in power query. But you can trigger power query operations by using vba, you can refer to the following documentation for more specific details about the operation.
excel - How to automate a power query in VBA? - Stack Overflow
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
You can use the result of power query into Vba or reverse, you can also schedule the query refresh time by via but you can't access to the middle level steps of power query by vba
From PowerQuery? Not possible I am afraid...
What are you trying to achieve?
What do you want to achieve? You want to use VBA for excel I assume? It's possible to view and change the content of a query or to create new queries. You can also Refresh tables based on a query. You cannot call VBA function from a query directly.
I had some good results with ChatGPT, but don't expect that to be first time right: You will still need to debug, simplify and understand the code yourself.
"I had some good results with ChatGPT"
Please write an example
Thank you
I want to run any VBA procedure
Call AAA("Hello")
Sub AAA(sNote as String)
MsgBox sNote
End Sub
Can you clarify with an example?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |