How to see if the opened workbook is opened by another user ?

  • Thread starter Thread starter balexis
  • Start date Start date
B

balexis

Hi,

I want to restrict the use of an Excel application to just one user at
a time. Basically, my application is composed of a few protected
sheets (user must not change the cells manually), and a toolbar with
macros associated.

I only want 1 user to be able to have to execute macros at the same
time. I would like to gray all the toolbar's buttons when the excel
file is already opened by another user.

Now, how can I detect that the excel file is already opened by another
user with vba code ?

Thank you for your help in advance,


Alex
 
Hi,

The file should be in readOnly mode.
This is what you have to check
If ActiveWorkbook.ReadOnly = true Then
Regards,

JY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top