ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
I'm not even entirely sure my code will work, but right now I'm getting stuck on something else
"Compile Error:
Procedure declaration does not match descfription of event or procedure having the same name"
Is the error I get when this fires:
No amount of tweaking seems to fix it.
And when it was working before, I had to have it look like thios to do anything:
What happens is that the sub "eh" fires a userform stored in the global.mpt (same deal as personal.xls) which gives a range of saving options (where, how, filenames, etc).
But I need a "Cancel - I did not mean to close the project..." and I can't seem to work one in.
Any ideas?
"Compile Error:
Procedure declaration does not match descfription of event or procedure having the same name"
Is the error I get when this fires:
Code:
Private Sub Project_BeforeClose(Cancel As Boolean)
Dim answer As String
Dim uname As String
uname = Environ("USERNAME")
answer = MsgBox("This is your only chance to Cancel the Closing of this workbook. After this message, you can only Save&Quit or just Quit", vbYesNo, "Last Chance to Cancel")
If answer = vbNo Then
Cancel = True
GoTo icancelled
Else
End If
If uname <> "ew" Then
Run "eh"
Else
End If
icancelled:
End Sub
No amount of tweaking seems to fix it.
And when it was working before, I had to have it look like thios to do anything:
Code:
Sub Project_BeforeClose(ByVal pj1 As Project)
If (pj1 Is Nothing) Then
End If
'...rest of code
End Sub
What happens is that the sub "eh" fires a userform stored in the global.mpt (same deal as personal.xls) which gives a range of saving options (where, how, filenames, etc).
But I need a "Cancel - I did not mean to close the project..." and I can't seem to work one in.
Any ideas?