Rudi,
Ik heb de onderstaande code ook al achter "this Workbook" staan:
Als ik jou code eronder zet, dan krijg ik bij het gebruik van een Save Macro (voor de gebruiker die niet in een Read Only versie zit) de melding:
Compile Error:
Ambiguous name detected: Workbook_BeforeClose
Daarna heb ik jou code in de bovenstaande code geplaatst(zie hieronder, maar dan is het niet mogelijk om het programma te sluiten als een andere gebruiker in de Read Only zit versie zit te kijken.
Dus mocht je een andere suggestie hebben, dan is dat nog steeds welkom.
Groeten en een gelukkig 2009
Humadgen
Ik heb de onderstaande code ook al achter "this Workbook" staan:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If BooleanForClosing = False Then
MsgBox "You cannot close EXCEL with the X" & vbCrLf & vbCrLf & _
"First close the Holiday Calendar 2009:" & vbCrLf & vbCrLf & _
"- Hit the BNYM Logo in the Calendar" & vbCrLf & vbCrLf & _
"- Followed by one of the EXIT buttons in the START screen!" _
, vbExclamation, "SAVE & EXIT"
Cancel = True
Exit Sub
End If
End Sub
Compile Error:
Ambiguous name detected: Workbook_BeforeClose
Daarna heb ik jou code in de bovenstaande code geplaatst(zie hieronder, maar dan is het niet mogelijk om het programma te sluiten als een andere gebruiker in de Read Only zit versie zit te kijken.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If BooleanForClosing = False Then
MsgBox "You cannot close EXCEL with the X" & vbCrLf & vbCrLf & _
"First close the Holiday Calendar 2009:" & vbCrLf & vbCrLf & _
"- Hit the BNYM Logo in the Calendar" & vbCrLf & vbCrLf & _
"- Followed by one of the EXIT buttons in the START screen!" _
, vbExclamation, "SAVE & EXIT"
Cancel = True
Exit Sub
End If
[COLOR="red"][B] If ThisWorkbook.ReadOnly = True Then
Cancel = True
End If[/B][/COLOR]
End Sub
Dus mocht je een andere suggestie hebben, dan is dat nog steeds welkom.
Groeten en een gelukkig 2009
Humadgen