ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Shared Workbook UserForms (https://www.excelbanter.com/excel-discussion-misc-queries/115042-shared-workbook-userforms.html)

Brendan Vassallo

Shared Workbook UserForms
 
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


Dave Peterson

Shared Workbook UserForms
 
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.


Brendan Vassallo wrote:

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


--

Dave Peterson

Brendan Vassallo

Shared Workbook UserForms
 
Thanks Dave

"Dave Peterson" wrote:

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.


Brendan Vassallo wrote:

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


--

Dave Peterson



All times are GMT +1. The time now is 06:09 AM.

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