Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make custom menu opened when workbook is opened

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
NL
i'm trying to add the custom menu when the workbook is opened and delete when the workbook is closed, but it doesnt' work, but macro RemoveCustomMenu() and AddCustomMenu() themselves work fine. why there codes dont' work?

Private Sub workbook_BeforeClose(Cancel As Boolean)
Call RemoveCustomMenu
End Sub

Private Sub Workbook_Open()
Call AddCustomMenu
End Sub

Public Sub RemoveCustomMenu()
........................
End Sub
Public Sub AddCustomMenu()
.........................
End Sub
 
xq,

Questions: When you say add/delete custom menu "doesn't work", do you mean nothing happens or do you get an error? If so, what error? Are the following actually in the ThisWorkbook code module?

Code:
Private Sub workbook_BeforeClose(Cancel As Boolean)
   Call RemoveCustomMenu
End Sub

Private Sub Workbook_Open()
   Call AddCustomMenu
End Sub


Regards,
M. Smith
 
thanks a lot, i've fixed the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top