Forum Discussion
sean_w
5 years agoFrequent Visitor
Power Query equivalent of PERSONAL.xlsb for queries, functions, etc.
Problem: I often find that I want or need to reuse a Power Query function or approach in one Excel workbook that I've used in a previous Excel Workbook, without the hassle of "reinventing the wheel"...
CNENFRNL
Community Champion
5 years agoTurn those reusable steps to user-defined functions.
(arg1, arg2, ...) =>
let
step1 = "...",
setp2 = "..."
...
setpn =
in
stepn- sean_w5 years agoFrequent Visitor
Yes - completely agreed and I do when it makes sense. However when a user-defined function (UDF) is created, it only exists (natively) within the workbook it's created in. Let's say I need to perform the same steps from the UDF but in a different Excel workbook. I either have to:
- Save that UDF into a text file when I create it in the original workbook, find that file, open & copy the text, create a new blank query, and paste in the text. Additionally, if I make any alterations to the UDF in the original workbook, I have to keep those changes in sync with the static text file.
- Remember which workbook the original UDF was in, open the file, copy the query/UDF, and paste into the new workbook. Same issue here - if for any reason I update the UDF in one and I need that update to apply to all instances of that UDF, I have to go find and update each manually.
The idea behind saving Excel macros to PERSONAL.xlsb is that it creates a single point for all macros you want available in other workbooks. My question is specific to this concept, but applied to Power Query.