ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA doesn't like sharing a spreadsheet (https://www.excelbanter.com/excel-programming/359451-vba-doesnt-like-sharing-spreadsheet.html)

ortp01[_2_]

VBA doesn't like sharing a spreadsheet
 

I'm sharing a spreadsheet on a network so some of the functionality of
my VBA code is not available. I'm therefore trying to write some code
to do one thing if it's shared, do another if it's stand-alone. Is
there therefore any way of determining within VBA whether a file is
shared or not ?


--
ortp01
------------------------------------------------------------------------
ortp01's Profile: http://www.excelforum.com/member.php...o&userid=33689
View this thread: http://www.excelforum.com/showthread...hreadid=534990


Bob Phillips[_6_]

VBA doesn't like sharing a spreadsheet
 
Try

Debug.Print Workbooks("myBook.xls").MultiUserEditing

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ortp01" wrote in
message ...

I'm sharing a spreadsheet on a network so some of the functionality of
my VBA code is not available. I'm therefore trying to write some code
to do one thing if it's shared, do another if it's stand-alone. Is
there therefore any way of determining within VBA whether a file is
shared or not ?


--
ortp01
------------------------------------------------------------------------
ortp01's Profile:

http://www.excelforum.com/member.php...o&userid=33689
View this thread: http://www.excelforum.com/showthread...hreadid=534990




ortp01[_3_]

VBA doesn't like sharing a spreadsheet
 

Wonderful !! I've had to change the syntax slightly to something
like...

thissheet = ActiveWorkbook.Name
If Workbooks(thissheet).MultiUserEditing = False Then' <<<<<<<<<<
strprompt = "False : ie not shared" & vbCrLf
varReturn = MsgBox(strprompt, vbOKOnly, strTitle)
Else
strprompt = "True: ie it's shared !" & vbCrLf
varReturn = MsgBox(strprompt, vbOKOnly, strTitle)
End If

Thank you ever so much. I would not have stumbled over this syntax and
the 'Help' was unhelpful. So your help is much appreciated !

Peter



Bob Phillips Wrote:
Try

Debug.Print Workbooks("myBook.xls").MultiUserEditing

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ortp01" wrote
in
message ...

I'm sharing a spreadsheet on a network so some of the functionality

of
my VBA code is not available. I'm therefore trying to write some

code
to do one thing if it's shared, do another if it's stand-alone. Is
there therefore any way of determining within VBA whether a file is
shared or not ?


--
ortp01

------------------------------------------------------------------------
ortp01's Profile:

http://www.excelforum.com/member.php...o&userid=33689
View this thread:

http://www.excelforum.com/showthread...hreadid=534990



--
ortp01
------------------------------------------------------------------------
ortp01's Profile: http://www.excelforum.com/member.php...o&userid=33689
View this thread: http://www.excelforum.com/showthread...hreadid=534990


Bob Phillips[_6_]

VBA doesn't like sharing a spreadsheet
 
We are the 'Help' <vbg

BTW this

If Workbooks(thissheet).MultiUserEditing = False Then'

can be shortened as you are doing a logivcl test, which can only evaluate to
True or false, so you can write

If Not Workbooks(thissheet).MultiUserEditing = Then

Bob

"ortp01" wrote in
message ...

Wonderful !! I've had to change the syntax slightly to something
like...

thissheet = ActiveWorkbook.Name
If Workbooks(thissheet).MultiUserEditing = False Then' <<<<<<<<<<
strprompt = "False : ie not shared" & vbCrLf
varReturn = MsgBox(strprompt, vbOKOnly, strTitle)
Else
strprompt = "True: ie it's shared !" & vbCrLf
varReturn = MsgBox(strprompt, vbOKOnly, strTitle)
End If

Thank you ever so much. I would not have stumbled over this syntax and
the 'Help' was unhelpful. So your help is much appreciated !

Peter



Bob Phillips Wrote:
Try

Debug.Print Workbooks("myBook.xls").MultiUserEditing

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ortp01" wrote
in
message ...

I'm sharing a spreadsheet on a network so some of the functionality

of
my VBA code is not available. I'm therefore trying to write some

code
to do one thing if it's shared, do another if it's stand-alone. Is
there therefore any way of determining within VBA whether a file is
shared or not ?


--
ortp01

------------------------------------------------------------------------
ortp01's Profile:

http://www.excelforum.com/member.php...o&userid=33689
View this thread:

http://www.excelforum.com/showthread...hreadid=534990



--
ortp01
------------------------------------------------------------------------
ortp01's Profile:

http://www.excelforum.com/member.php...o&userid=33689
View this thread: http://www.excelforum.com/showthread...hreadid=534990





All times are GMT +1. The time now is 02:14 PM.

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