I have a large shared workbook that is used between 8-10 people at my work. I am working on some macros and general VBA code to accomplish some basic functions, and have a few questions about how they will interact with the shared workbook.
In a shared workbook, if I assign a macro to a button that schedules a task via Application.OnTime, will that macro be run when scheduled on all open instances of the workbook or only the one that called the schedule macro? ie, if the macro opens a MsgBox, will it open it for everyone or just one instance?
If it does run for all instances, is there a way to specify exactly which instance I want, for example, a MsgBox to appear for? Am I able to specify based on workstation name or instance name?
I have done a few tests and it appears to not run on all open instances of the workbook, but I am not 100% sure. Any help regarding this is appreciated!
CodePudding user response:
VBA Code runs only on the Excel instance it was started. Therfore message boxes and ontime schedules will only run on that instance too.
Note that if multiple users start a VBA code it will run for each of those instances it was started at.