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

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,215,972
Messages
6,128,035
Members
449,414
Latest member
sameri

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