I develop VBA code using some advanced automated macros that do "plumbing" and extra debugging during DEV phase. However, when I ship the files to users (PROD phase), I want all of this to be turned off.
Those switches between DEV and PROD happen quite a lot (git + devops methodology).
What would be the best / most elegant way to implement a quick "switch" between DEV and PROD? Yes, I could just use a global Const isDebug (and I did it for some projects), but it's burdensome, inelegant and error-prone (more than once I forgot to "flip" the switch - as I said earlier, quick and agile "almost" CI/CD pipeline).
EDIT
Right now I'm using a quick dirty hack (I don't like dirty hacks) that checks whether the Excel file is being ran from a location with my login name in the path. If yes - that means I'm working on the file. If no - someone else is using it and we don't need any debugging modes. But it's ugly and I can foresee a lot of problems (for one, tomorrow someone else might be developing those VBAs... so the debug code would have to be rewritten).