@ExcelOffTheGrid

Sign up for our free Insiders program and get the example file:
Click here: https://exceloffthegrid.com/insiders/

File Reference for this video: 0262 Automate Power Query with VBA

@vinothkumarmanoharan2317

I used multiple power queries with vba to automate but this is a extremely unique video for me and first time I'm seeing something like this..

@shellycastille4991

O-M-G. You made this just for me, right?  LOL. Thank you so much. This is going to save me a ton of time!

@lapaleves

i made the observation, that when refreshing more queries by macro, the custom PQ errors will only show the proper text if the sheet where the table output resides is selected during refresh. might be that my logic is flawed, but i remember fighting with it quite some time. my macro now activates each sheet prior refresh and the custom error texts are also available for the macro, to write into cells etc. (like if a source file is not present, then in the second PQ step i fake an empty(ish) table and create the PQ error. like that a result is returned to Excel, and i can write into the empty result table "no file found" or something (besides the message box popping up also with details instead of a blank 1004 run-time).

@jakubspevacek3357

Great tips, thank you!

@chrism9037

Mark, this was really great.  Incredibly helpful!

@GiliMili-lw3ys

Amazing !!!!

@christianmarpert3844

great idea to store your pq functions and importing them dynamically into pq! thks for that!
 I was fighting with creating a pq reusable library to be imported, but never really managed so. As I have my custom xlam, the storing of the pq functions in a personal workbook would not work for me, but I could hardcode them into vba. Or maybe you have an even better idea to avoid all the escaping of special characters? maybe storing in a textfile and reading them?🤔 

anyway, thks a lot for sharing!

@kebincui

Awesome as always👍, thanks Mark❤

@Sri-Nivas

1:34 we can do this with the "Refresh All" option. Right?

@chta2010

Really good stuff, thank you very much!

@DanielADamico

awesome video 👏👏

@edoggamus

Best excel content

@nazarkamal8831

Amazing thanks 🙏👍❤

@KlausTrapp

Das ist sehr hilfreich Dankeschön 👍

@vadimcherepanov3339

With… end with + iif

@HasnainSabir-y1i

Usually with power query refresh excel become with this trick is excel work in the background and active file can be work like normal file?

@robbyl12

Nice job! Could you also please make a video about how to unpivot by dynamic array formula?

@HasnainSabir-y1i

What about the python?

@sledgehammer-productions

I mainly use VBA to refresh the Power Query's in the file 🙂. 
Why Refresh in the Background is ticked by default is beyond me. 
And when I copy an 'unticked' Power Query, the new one again has that tick again. So annoying.