Shared Workbook UserForms

G

Guest

Hi All,

I have a Shared Workbook that contains macros. Some of these macros use
UserForms. On one of the UserForms there is a button that I want disabled
unless the Workbook is not shared as I go in every morning to make a back up
and update the Pivot Tables. I have set the button to "Enabled = False" when
the UserForm is initialised but do not know how to get the macro to test to
see if the Workbook is shared so that if this is false I can enable the
button.

Can anyone help?

Brendan Vassallo
 
D

Dave Peterson

Take a look at ExclusiveAccess in VBA's help.

You'll see this as an example:

If ActiveWorkbook.MultiUserEditing Then
ActiveWorkbook.ExclusiveAccess
End If

So you could test the .multiuserediting property of the workbook to determine
the "sharedness" of the workbook.
 
G

Guest

Thanks Dave

Dave Peterson said:
Take a look at ExclusiveAccess in VBA's help.

You'll see this as an example:

If ActiveWorkbook.MultiUserEditing Then
ActiveWorkbook.ExclusiveAccess
End If

So you could test the .multiuserediting property of the workbook to determine
the "sharedness" of the workbook.
 

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

Top