By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

How do I ensure two users don't run a macro at the same time

P: 1
I have a macro that is pulling data from a linked table, creating several summary tables, and then exporting the results to Excel. Id like to make this available to other users but Im concerned that if two users run the macro at the same time they will create inconsistent results. Id like to find some way to ensure that two users are not running the macro concurrently.
Sep 4 '08 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,347
One simple technique is to have a table where your running the macro is logged.

Add a record before starting the rest of the macro (only if there is no currently existing record for this job) and delete it when finished.

It can be as limited or flexible as you want to make it.
Sep 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.