Michael Pettinicchi
Board Regular
- Joined
- Apr 11, 2002
- Messages
- 53
I have the following code in the "Workbook" of "ThisWorkbook". It works if I open the file directly, i.e., it does the job and closes. But, if I open the file via another Excel file, it doe the job but doesn't close. What's wrong?
Private Sub Workbook_Open()
Application.EnableCancelKey = xlDisabled
Range("a5").Select
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Sheets("Sheet1").Activate
ActiveWorkbook.Activate
ActiveWorkbook.Close
End Sub
Thanks
Michael
Private Sub Workbook_Open()
Application.EnableCancelKey = xlDisabled
Range("a5").Select
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Sheets("Sheet1").Activate
ActiveWorkbook.Activate
ActiveWorkbook.Close
End Sub
Thanks
Michael