Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Determine if a workbook is shared

Can someone please reply with example code on how to determine if a workbook is shared

Thanks much in advance...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Determine if a workbook is shared

quartz

The only way I know is to check the Title bar for [Shared]. The problem is
that if the ActiveWindow is not maximized with Excel, [Shared] doesn't show
up there - and, for some reason, it doesn't show up in ActiveWindow.Caption
either. I came up with maximizing the ActiveWindow, reading the title bar
and checking for [Shared]. Also, you can't turn off ScreenUpdating because
the title bar won't update. Here's what I have:

Sub CheckShared()

Dim OldState As XlWindowState
Dim Msg As String

OldState = ActiveWindow.WindowState

ActiveWindow.WindowState = xlMaximized

If InStr(1, Application.Caption, "[Shared]") 0 Then
Msg = ActiveWorkbook.Name & " is shared"
Else
Msg = ActiveWorkbook.Name & " is not shared"
End If

ActiveWindow.WindowState = OldState

MsgBox Msg

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.



"quartz" wrote in message
...
Can someone please reply with example code on how to determine if a

workbook is shared?

Thanks much in advance...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Determine if a workbook is shared

Hi Dick,

How about using the MultiUserEditing property?

Function IsShared(Bookname As String) As Boolean
IsShared = Workbooks(Bookname).MultiUserEditing
End Function

Cheers
Andy

Dick Kusleika wrote:

quartz

The only way I know is to check the Title bar for [Shared]. The problem is
that if the ActiveWindow is not maximized with Excel, [Shared] doesn't show
up there - and, for some reason, it doesn't show up in ActiveWindow.Caption
either. I came up with maximizing the ActiveWindow, reading the title bar
and checking for [Shared]. Also, you can't turn off ScreenUpdating because
the title bar won't update. Here's what I have:

Sub CheckShared()

Dim OldState As XlWindowState
Dim Msg As String

OldState = ActiveWindow.WindowState

ActiveWindow.WindowState = xlMaximized

If InStr(1, Application.Caption, "[Shared]") 0 Then
Msg = ActiveWorkbook.Name & " is shared"
Else
Msg = ActiveWorkbook.Name & " is not shared"
End If

ActiveWindow.WindowState = OldState

MsgBox Msg

End Sub


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Determine if a workbook is shared

Andy

Well, that sure makes things easy.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Andy Pope" wrote in message
...
Hi Dick,

How about using the MultiUserEditing property?

Function IsShared(Bookname As String) As Boolean
IsShared = Workbooks(Bookname).MultiUserEditing
End Function

Cheers
Andy



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
shared workbook is set up is not 'shared' on network moviemaker novice Excel Worksheet Functions 0 April 7th 10 03:31 AM
shared workbook - shared workbook options grayed out Edward Letendre Excel Discussion (Misc queries) 0 March 3rd 10 10:47 PM
Printing viewing a shared workbook on a shared drive aloomba Excel Discussion (Misc queries) 0 April 13th 07 02:52 PM
How do I determine how many worksheets a workbook has at a glance dm Excel Worksheet Functions 3 March 5th 07 07:53 PM
update pivot in shared shared workbook 00George00 Excel Discussion (Misc queries) 1 August 23rd 06 08:16 PM


All times are GMT +1. The time now is 04:23 PM.

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"