ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_Open() does not work (https://www.excelbanter.com/excel-programming/367043-workbook_open-does-not-work.html)

Ken

Workbook_Open() does not work
 
I'm using Excel 2003 with SP2. The Workbook_Open() does not work. For
example, the following macro will work if you run it manually in the VB
editor, but will not run when the workbook opens. None of my Workbook_Open()
macros work. The macro is placed in the ThisWorkbook object. Can anyone
help me?

Private Sub Workbook_Open()
MsgBox Date
Worksheets("Sheet1").Range("A1").Value = Date
End Sub



Bob Umlas

Workbook_Open() does not work
 
works fine for me -- are you sure you have Application.EnableEvents set to
True?

"Ken" wrote in message
...
I'm using Excel 2003 with SP2. The Workbook_Open() does not work. For
example, the following macro will work if you run it manually in the VB
editor, but will not run when the workbook opens. None of my
Workbook_Open()
macros work. The macro is placed in the ThisWorkbook object. Can anyone
help me?

Private Sub Workbook_Open()
MsgBox Date
Worksheets("Sheet1").Range("A1").Value = Date
End Sub





NickHK

Workbook_Open() does not work
 
And is it located in the Thisworkbook module ?

NickHK


"Ken" wrote in message
...
I'm using Excel 2003 with SP2. The Workbook_Open() does not work. For
example, the following macro will work if you run it manually in the VB
editor, but will not run when the workbook opens. None of my

Workbook_Open()
macros work. The macro is placed in the ThisWorkbook object. Can anyone
help me?

Private Sub Workbook_Open()
MsgBox Date
Worksheets("Sheet1").Range("A1").Value = Date
End Sub





Ken

Workbook_Open() does not work
 
Bob,
I do have application.enable =true. I believe it's a problem with Excel
2003 because it will work with Excel 2000 no problem. Any other ideas?


"Bob Umlas" wrote:

works fine for me -- are you sure you have Application.EnableEvents set to
True?

"Ken" wrote in message
...
I'm using Excel 2003 with SP2. The Workbook_Open() does not work. For
example, the following macro will work if you run it manually in the VB
editor, but will not run when the workbook opens. None of my
Workbook_Open()
macros work. The macro is placed in the ThisWorkbook object. Can anyone
help me?

Private Sub Workbook_Open()
MsgBox Date
Worksheets("Sheet1").Range("A1").Value = Date
End Sub







All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com