You are viewing a single comment's thread from:

RE: Excel & VBA development with GitHub

in #vba7 years ago

Hi Koen,

thanks for the article (funnily, I've actually come across your crypto currency workbook on GitHub in a completely different context).

I've recently written about using the git pre-commit hook to take care of auto-exporting VBA code from a workbook. In other words, every time you do git commit, git executes a little Python script that grabs the VBA modules from the workbook, writes it to the file system and adds it to the commit: https://www.xltrail.com/blog/auto-export-vba-commit-hook

What are your thoughts on that?

Sort:  

Hi Björn,
thanks for your feedback! I do like your example, it does make life more convenient for some people. It does however have two drawbacks for me:

  • I would have to install & learn python (I do speak it a little). I do like to stick to my Excel/VBA only setup (with the GitHub GUI). It's basically the "lowest/least tech option".
  • In my setup there are some modules I don't want to export, have a test module and one with my API keys. I prefer those not to end up on the web, so still have to white list my modules somewhere.

I'm trying to come up with an answer to your statement that "You are dependent on Excel, so if you copy your workbook from an email or another folder into your Git repository folder, your VBA export function will not run. "
My macro runs just fine, it's only that my export directory settings are fixed in my Excel-dev file. What I've once built is an extra settings file in my work directory. On opening my workbook, the workbook looks for that settings file in the same directory it is located. It than grabs those settings and runs on whatever machine or give an error if it can't find the settings nor the normal GitHub directory.