Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Excel Spreadsheet Sid Excel Discussion (Misc queries) 0 September 13th 07 01:54 AM
Spreadsheet sharing and VBA ortp01 Excel Programming 0 April 20th 06 04:46 PM
sharing data between sheets in a spreadsheet [email protected] Excel Discussion (Misc queries) 2 February 23rd 06 02:35 PM
sharing a spreadsheet on a network drive Abbey Normal Excel Discussion (Misc queries) 3 June 14th 05 07:17 PM
Refreshing / sharing an Excel spreadsheet Don Wilkin Excel Programming 0 April 29th 04 04:10 PM


All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"