I would like to create a macro that opens as soon as the excel file is opened, and does not allow any action until authentication is made.
The idea is that the login macro, when authentication succeeds, will call another macro that makes a connection to a database and calls a procedure that will populate the sheets, which I also have doubts about how to make, since it has to connect to a database.
The authentication process needs to read the information on a user form and be able to send it as a parameter to a procedure in SQL so that it returns whether the authentication was successful or not.
Any suggestions? Thank you in advance!