I'm working on some VBA scripts for an Excel worksheet, and I've created a module that contains a whole listing of mostly strings that store the name of each of my database fields. That way, if anyone modifies the database, they can update the VBA variable in the module, and then all my scripts, which reference the global variable instead of the field name directly, don't even know the difference.
Anyway, I'm going to be working in a few different unrelated excel sheets, and I'd like them all to have access to that module. Worst case, I could copy the module manually to each workbook, but it would be awesome if they could all externally reference the same exact file... is something like that possible in VBA/Excel?
Also, right now my variables look simply like:
Global tblDeviceType As String
And then I initialize them in a function in the module that gets called when the workbook opens. Is there a better way to maintain all my constants or does this work?
Oh yeah, and I didn't actually declare them as constants since some of them have more complex datatypes (like Ranges) and couldn't be statically declared - at least it didn't seem like they could.