Howdy all,
I'm running Excel 2013 and my workgroup is dead set on running in a shared workbook. I have tried to convince them otherwise but no go. I revised all of my VBA macros to deal with the shared workbook issue by either working around it when possible or making the sheet exclusive when necessary then resharing the workbook. Problem is when the macro pulls the workbook from being shared only the person making the sheet exclusive gets any warning. For instance if someone runs the script they get a warning that they are about to unshare the workbook and they can say "go for it" but once that's done anyone else in the workbook has no idea it's happened until they try to save their work, then they get a notice. I don't need to get any input from the other users and I don't need them to be able to stay in the workbook, I just want for all the users currently in the shared workbook to get a popup that alerts them they are about to get excluded.
Here's my check for shared workbook and reestablish shared workbook, that are at the beginning and end of some of my scripts:
'Check if the workbook is Shared, if so kill it
If ActiveWorkbook.MultiUserEditing Then
ActiveWorkbook.ExclusiveAccess
SharedCheck = True
Else
SharedCheck = False
End If
'Reestablish shared workbook
If SharedCheck = True Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs ActiveWorkbook.Name, accessmode:=xlShared
Application.DisplayAlerts = True
MsgBox "Workbook has been made a Shared Workbook again"
End If
Appreciate any help that can be offered.
Bookmarks