VBA macro code for Opening a particular xlslx file from power query

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
688
Any VBA code for Opening a particular xlslx file from power query


Using Excel 2013 few days back installed power query


1. In excel I click on Power Query
2. then click on From File
3. then click From Excel
so i get option to choose the file . (in fact thru macro i want directly to open)


What is the macro code for the above 3 steps ? So step by step with correct syntax i can reach my objective.


What i would like is to, with macro code, directly open the same file with format i require in power query.
This will stop my addtional working on another step to open the file and re structure the format.


Regards
NimishK
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I assume you have tried the macro recorder and it didn't return any code. I don't believe you can execute individual Power Query steps from within VBA.

Once you have created the query, of course you can refresh it via VBA. But it sounds like you want to have a quick way to open a new query that points to an Excel file. You could create a generic preliminary query within Power Query with those 3 steps and go to it directly via the Query editor, then copy the resulting customizations to a new query.
 
Upvote 0
Macfuller:
I don't believe you can execute individual Power Query steps from within VBA.
Somewhere some PQ commands/Syntaxes will be there within VBA or MS-VBA have not incorporated them at all.

Anyways Thanks Macfuller and HorseyRide for your replies.
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,106
Members
452,302
Latest member
TaMere

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