VBA to enable Power Query

ajw5173

New Member
Joined
Apr 7, 2016
Messages
45
Hi,

I have a workbook that opens on the Microsoft scheduler. The workbook requires Power Query to run correctly and for some reason it wont load power query before it starts processing. Is there any way to make power query load with <acronym title="visual basic for applications">VBA</acronym> or any other possibly workaround to get this to work?

Thanks!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
When I use the scheduler to open up a workbook that runs a macro on open Power Query doesn't load.
 
Upvote 0
what do you mean "load"? Are you saying that there is no Power Query menu? That is what load means. Is there a Power Query menu when you open the workbook yourself?
Or are you instead saying that it doesn't refresh? If so, are you triggering the refresh event in Power Query?
 
Upvote 0
There is no power query menu on top while the query is running. The query fails because it says there is no PQ. I then hit debug and PQ pops up and if I try to run the macro again everything works.
 
Upvote 0
And is the Power Query menu there when you open it normally? If so, it sounds like Power Query is not installed for all users, and maybe the System Tasks is using a different user account. Just a guess
 
Upvote 0
And is the Power Query menu there when you open it normally? If so, it sounds like Power Query is not installed for all users, and maybe the System Tasks is using a different user account. Just a guess

This is also happening to me, the problem as Microsoft says in this post is that the Add-in doesn't always load. I have it configured to always load, but that doesn't always happen (opening Excel normally or through a VBA process) the solution is disable it and enable it again so the ribbon appears. Since I'm doing an automated update of my workbook through a VBA macro, I would need to do this procedure of disable and enable the Power Query Add-In in VBA, any idea how?
 
Upvote 0
Hello!

After doing some more research I found the post http://www.mrexcel.com/forum/excel-questions/451239-disabling-com-add.html I added to my code the VBA instructions to Disable and Enable the Power Query COM Add-In that is posted on the MS Support page to solve the ribbon not appearing even though the Add-In is supposed to be enabled. I'll be testing it tomorrow when the Windows Scheduler runs, but looks like it does the trick.

Code:
[FONT=lucida console]Application.COMAddIns("Microsoft.Mashup.Client.Excel").Connect = False 'Disable Power Query[/FONT]
[FONT=lucida console]
[/FONT]
[FONT=lucida console]Application.COMAddIns("Microsoft.Mashup.Client.Excel").Connect = True  'Enable Power Query[/FONT]

Hope it helps ajw5173!!!
 
Upvote 0

Forum statistics

Threads
1,216,050
Messages
6,128,498
Members
449,455
Latest member
jesski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top