PC Review


Reply
Thread Tools Rate Thread

Custom Menu Issue.

 
 
=?Utf-8?B?QXlv?=
Guest
Posts: n/a
 
      6th Sep 2007
I created a custom mene that I assigned a macro to. But it keeps showing up
in other files.
How do I get it to show only in the workbook it was created for and not in
every other workbook.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2V2aW4gQg==?=
Guest
Posts: n/a
 
      6th Sep 2007
In the workbook module, apply the following to the Activate/Deactivate
Open/Before close workbook triggers:
*************************************************
Private Sub Workbook_Activate()

Workbook_Open

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Application.CommandBars("Your_Menu_Name_Here").Visible = False

End Sub

Private Sub Workbook_Deactivate()

Workbook_BeforeClose True

End Sub

Private Sub Workbook_Open()

Application.CommandBars("Your_Menu_Name_Here").Visible = True

End Sub

*************************************************
--
Kevin Backmann


"Ayo" wrote:

> I created a custom mene that I assigned a macro to. But it keeps showing up
> in other files.
> How do I get it to show only in the workbook it was created for and not in
> every other workbook.

 
Reply With Quote
 
=?Utf-8?B?QXlv?=
Guest
Posts: n/a
 
      7th Sep 2007
I keep getting the "Invalid procedure call or argument" error on:
Application.CommandBars("Generate Report").Visible = True and
Application.CommandBars("Generate Report").Visible = False

What am I doing wrong?

"Kevin B" wrote:

> In the workbook module, apply the following to the Activate/Deactivate
> Open/Before close workbook triggers:
> *************************************************
> Private Sub Workbook_Activate()
>
> Workbook_Open
>
> End Sub
>
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
>
> Application.CommandBars("Your_Menu_Name_Here").Visible = False
>
> End Sub
>
> Private Sub Workbook_Deactivate()
>
> Workbook_BeforeClose True
>
> End Sub
>
> Private Sub Workbook_Open()
>
> Application.CommandBars("Your_Menu_Name_Here").Visible = True
>
> End Sub
>
> *************************************************
> --
> Kevin Backmann
>
>
> "Ayo" wrote:
>
> > I created a custom mene that I assigned a macro to. But it keeps showing up
> > in other files.
> > How do I get it to show only in the workbook it was created for and not in
> > every other workbook.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating custom Message Form. Issue with custom Icon Abhishek Tripathi Microsoft Outlook Form Programming 0 1st Dec 2008 11:39 AM
Custom Context menu (Right click menu) not working in sheet changeevent. Madiya Microsoft Excel Programming 3 11th Feb 2008 01:24 PM
Custom Shortcut Menu Bar Issue =?Utf-8?B?SHVja2xl?= Microsoft Access 1 2nd Aug 2006 03:43 PM
Not able to call a function from custom menu item that is added in word menu(File) jayrm100@yahoo.com Microsoft Word Document Management 0 9th Nov 2005 05:36 AM
Custom Popup menu in custom control and powerpoint Rajesh Microsoft Powerpoint 1 1st Mar 2004 01:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:30 AM.