bloodmilksky
Board Regular
- Joined
- Feb 3, 2016
- Messages
- 202
Hi Guys,
Trying to get the below code running on a new workbook. worked perfectly fine on other one, have entered it in to new workbook and when I open it the code doesnt run. Can anyone help please?
Private Sub Workbook_open()
Msg = "Would You Like To Book Holidy ? " & Application.UserName
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbNo Then
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit
End If
If Ans = vbYes Then Range("EMPLOYEE2") = Application.UserName
End Sub
Trying to get the below code running on a new workbook. worked perfectly fine on other one, have entered it in to new workbook and when I open it the code doesnt run. Can anyone help please?
Private Sub Workbook_open()
Msg = "Would You Like To Book Holidy ? " & Application.UserName
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbNo Then
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit
End If
If Ans = vbYes Then Range("EMPLOYEE2") = Application.UserName
End Sub