sio / LibPQ

Detach your M code from workbooks to reuse it! Import modules from local or web storage (unlimited number of sources)
Apache License 2.0
76 stars 21 forks source link

VBA to update ThisWorkbook's path and directory #10

Closed sio closed 6 years ago

sio commented 6 years ago

Create VBA function (on Workbook_Open) to update the path to the current directory and the current workbook in the custom query.

Idea:

ThisWorkbook = 
[
  folder = "C:/Docs/",
  path = "C:/Docs/Workbook.xlsm",
  filename = "Workbook.xlsm"
]

Inspired by http://excelunplugged.com/2018/01/23/modifying-power-query-m-code-with-vba/

sio commented 6 years ago

Implemented in https://github.com/sio/LibPQ/blob/master/VBA/LibPQ_ThisWorkbook.bas