sideburnsurfer79
New Member
- Joined
- Mar 8, 2010
- Messages
- 7
Hi all. First post so please be kind. After searching this site and it seems, the entire of google, I have accepted defeat and I come to you cap in hand.
I have an excel workbook (2003) that around 5/6 people have access to. I wanted some version control auto saving and found a macro to do what I wanted and this part of the code works fine. However, the other bit does not.
I would like for the following to happen:
If someone is already in the workbook, it will usually give a message box that gives the option of 'read-only', 'notify' or 'cancel'. I don't want this to happen. I do not want anyone to be able to view a read only if someone is viewing it already. I found a code that looks like it should work but I just can't stop the 'read-only', 'notify' or 'cancel' box appearing and replacing it with my message box.
The full code is:
---------------------------
Private Sub Workbook_Open()
Dim blnReadonly As Boolean
blnReadonly = ThisWorkbook.ReadOnly
If blnReadonly = True Then
MsgBox ("Another user is currently working with this. Please pop back later")
Application.Quit
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With ActiveWorkbook
.Save
filepath = .Path
.SaveAs filepath & "\Jobstatus" & Date$ & Timer & ".xls"
.Close
End With
End Sub
--------------------------
Any help, suggestions are more than welcome. Thanks in advance
Tom
I have an excel workbook (2003) that around 5/6 people have access to. I wanted some version control auto saving and found a macro to do what I wanted and this part of the code works fine. However, the other bit does not.
I would like for the following to happen:
If someone is already in the workbook, it will usually give a message box that gives the option of 'read-only', 'notify' or 'cancel'. I don't want this to happen. I do not want anyone to be able to view a read only if someone is viewing it already. I found a code that looks like it should work but I just can't stop the 'read-only', 'notify' or 'cancel' box appearing and replacing it with my message box.
The full code is:
---------------------------
Private Sub Workbook_Open()
Dim blnReadonly As Boolean
blnReadonly = ThisWorkbook.ReadOnly
If blnReadonly = True Then
MsgBox ("Another user is currently working with this. Please pop back later")
Application.Quit
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With ActiveWorkbook
.Save
filepath = .Path
.SaveAs filepath & "\Jobstatus" & Date$ & Timer & ".xls"
.Close
End With
End Sub
--------------------------
Any help, suggestions are more than welcome. Thanks in advance
Tom