ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to see if the opened workbook is opened by another user ? (https://www.excelbanter.com/excel-programming/307322-how-see-if-opened-workbook-opened-another-user.html)

balexis

How to see if the opened workbook is opened by another user ?
 
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

Jean-Yves[_2_]

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

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

JY

"balexis" wrote in message
om...
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





All times are GMT +1. The time now is 11:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com