VBA - Back End Applications
When developing VBA applications for a considerable high amount of users, you should be able to control every user code from a centralized module. Think about a company with 500 users using an Excel application you built. The customers use Excel as a database to store monthly data. Every day they run an application that organizes new fields to the respective sheet. One day, you notice a bug that affects every user. Grabbing a fresh copy is not an option, every user will lose months of work. Your only option is to go computer by computer doing the manual update in their specific workbook or, creating an application that goes to everyone's computer, finds the workbook, open it, and modify the code. This last option is very, very risky and I would not recommend it at all. You could encounter a lot of problems while doing it. On the contrary, if everyone's Excel application could point to a centralized workbook where the code to run the procedures and functions is located, you will only need to modify that centralized file and everyone's bug would be fixed.
Think of a centralized workbook as a Back End server for your Front End Excel workbooks. Imagine having a button in the main Workbook, and the only code in that workbook to be the code to open the centralized file with the rest of the code that will perform the actual operation. Something like this:
Even though the code looks kind of long, if you read it, you will see that it's pretty straightforward. I added some comments to the code for you to understand what we are trying to achieve.
Something like:
Having centralized code is a very handy and easy way to control from a single point what the rest of the users are going to be interacting with. By operating your applications from a central source of code, you ensure that every user receives the same outcome without having to update their respective code individually. This is especially useful for developers designing applications that are going to be used for a vast amount of users.
TIp: Always remember to have you centralized code protected so no one but you, the developer, can modify the code.
That's all folks... Cheers,
Comments
Post a Comment