CaptainGravyBum
Board Regular
- Joined
- Dec 1, 2023
- Messages
- 77
- Office Version
- 365
- Platform
- Windows
Hello,
Sorry I've been a bit needy on here lately.
I have a macro enabled workbook that I've been working on and it's pretty much complete - at least I thought it was until I asked another person to try it on their PC. When they close the workbook, the runtime error above appears. It works fine on my PC and I tried enabling macros on their PC as I thought it could be the issue but it hasn't made a difference.
The only thing I can think it relates to is the following code which runs on close:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Cross-Charge Request").Select
Range("E4,E5,E6,B8:F10").Select
Selection.ClearContents
Range("E4").Select
MsgBox "Cross Charge Request Form Updated"
Application.DisplayAlerts = False
If Saved = False Then
ActiveWorkbook.Save
End If
Application.DisplayAlerts = True
End Sub
I've been staring at this and can't see the problem, can anyone else help?
Sorry I've been a bit needy on here lately.
I have a macro enabled workbook that I've been working on and it's pretty much complete - at least I thought it was until I asked another person to try it on their PC. When they close the workbook, the runtime error above appears. It works fine on my PC and I tried enabling macros on their PC as I thought it could be the issue but it hasn't made a difference.
The only thing I can think it relates to is the following code which runs on close:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Cross-Charge Request").Select
Range("E4,E5,E6,B8:F10").Select
Selection.ClearContents
Range("E4").Select
MsgBox "Cross Charge Request Form Updated"
Application.DisplayAlerts = False
If Saved = False Then
ActiveWorkbook.Save
End If
Application.DisplayAlerts = True
End Sub
I've been staring at this and can't see the problem, can anyone else help?