Private Sub Workbook_Open() & Workbook_BeforeClose(cancel As Boolean)

H

halibut

Private Sub Workbook_BeforeClose(cancel As Boolean)
Application.CommandBars("Pack tool bar").Visible = False
End Sub

Private Sub Workbook_Open()
Sheet1.Range("e3").Value = Sheet1.Range("ap3").Value
Application.CommandBars("Pack tool bar").Visible = True
Application.CommandBars("Pack tool
bar").Controls("Import").OnAction = "Import"
Application.CommandBars("Pack tool bar").Controls("Print
Pack").OnAction = "Printmacro"
Application.CommandBars("Pack tool bar").Controls("Roll
TB").OnAction = "Periodchange"
Application.CommandBars("Pack tool bar").Controls("Reset
Pack").OnAction = "Reset"
End Sub

These two routines do not work (they work on other installations of
excel on other computers) when the workbook is opened. In fact any code
I try and run from the Workbook_Open() & Workbook_BeforeClose(cancel As
Boolean) does not work on my installation of Excel 2003 it only works
if i run it manually.

Does any one have any ideas why? Are there any settings I have
inadvertently changed?
 
K

kassie

Did you put this code in a module, or in This Workbook? The latter is the
right place
 
J

Jim Cone

Try running this line of code and see if turns things back on...
Application.EnableEvents = True
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"halibut" <[email protected]>
wrote in message
Private Sub Workbook_BeforeClose(cancel As Boolean)
Application.CommandBars("Pack tool bar").Visible = False
End Sub

Private Sub Workbook_Open()
Sheet1.Range("e3").Value = Sheet1.Range("ap3").Value
Application.CommandBars("Pack tool bar").Visible = True
Application.CommandBars("Pack tool
bar").Controls("Import").OnAction = "Import"
Application.CommandBars("Pack tool bar").Controls("Print
Pack").OnAction = "Printmacro"
Application.CommandBars("Pack tool bar").Controls("Roll
TB").OnAction = "Periodchange"
Application.CommandBars("Pack tool bar").Controls("Reset
Pack").OnAction = "Reset"
End Sub

These two routines do not work (they work on other installations of
excel on other computers) when the workbook is opened. In fact any code
I try and run from the Workbook_Open() & Workbook_BeforeClose(cancel As
Boolean) does not work on my installation of Excel 2003 it only works
if i run it manually.
Does any one have any ideas why? Are there any settings I have
inadvertently changed?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top