Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command Bar Menu - Management


I am not a programmer, but somehow I got assigned this task for knowin
enough about excel functions.


I am having an issue, where I have a general custom menu called Report
where I have a few macros running reports for a few people. However
different people within that group have individual reports, as well a
individuals that do not have the general reports may have an individua
one.

The problem I am running into, while trying to be consistent across th
board, is that all the reports (individual or general) are trying to us
the same menu name: "Reports" so if an individual has multiple report
from seperate macros they end up with 2-3 different menu choices whe
all three macros are opened. I need a way to say I
reportmenudoesnotexist Then create reportmenu End If

--
kralj
-----------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php...nfo&userid=995
View this thread: http://www.excelforum.com/showthread.php?threadid=27246

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Command Bar Menu - Management

This will insert the Reports Menu just in front of Help, if it doesn't
already exist:

Dim ctlReports As CommandBarControl
With CommandBars(1)
On Error Resume Next
Set ctlReports = .Controls("Reports")
On Error GoTo 0
If ctlReports Is Nothing Then
Set ctlReports = .Controls.Add( _
Type:=msoControlPopup, _
Befo=.FindControl(Id:=30010).Index, _
Temporary:=True)
ctlReports.Caption = "Reports"
End If
End With


In article ,
kraljb wrote:

I am not a programmer, but somehow I got assigned this task for knowing
enough about excel functions.


I am having an issue, where I have a general custom menu called Reports
where I have a few macros running reports for a few people. However,
different people within that group have individual reports, as well as
individuals that do not have the general reports may have an individual
one.

The problem I am running into, while trying to be consistent across the
board, is that all the reports (individual or general) are trying to use
the same menu name: "Reports" so if an individual has multiple reports
from seperate macros they end up with 2-3 different menu choices when
all three macros are opened. I need a way to say If
reportmenudoesnotexist Then create reportmenu End If.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Command Bar Menu - Management

Generally, it would be something like

On Error Resume Next
Set oCB = Application.CommandBars("myReports")
On Error GoTo 0

If oCB Is Nothing Then
'CreateIt
End If

but show us the code if this doesn't solve it

--

HTH

RP

"kraljb" wrote in message
...

I am not a programmer, but somehow I got assigned this task for knowing
enough about excel functions.


I am having an issue, where I have a general custom menu called Reports
where I have a few macros running reports for a few people. However,
different people within that group have individual reports, as well as
individuals that do not have the general reports may have an individual
one.

The problem I am running into, while trying to be consistent across the
board, is that all the reports (individual or general) are trying to use
the same menu name: "Reports" so if an individual has multiple reports
from seperate macros they end up with 2-3 different menu choices when
all three macros are opened. I need a way to say If
reportmenudoesnotexist Then create reportmenu End If.


--
kraljb
------------------------------------------------------------------------
kraljb's Profile:

http://www.excelforum.com/member.php...fo&userid=9955
View this thread: http://www.excelforum.com/showthread...hreadid=272466



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros and Menu Command mary Excel Discussion (Misc queries) 2 September 7th 07 07:00 PM
How disable menu command Armangelo Excel Discussion (Misc queries) 0 February 1st 06 10:00 AM
Name command in Insert Menu Ahmad Wali Zahid Excel Discussion (Misc queries) 1 January 31st 06 08:37 AM
there is no XML command on my data menu Mattie Excel Worksheet Functions 1 November 27th 04 09:00 AM
Execute a menu command with VBA? Susan[_3_] Excel Programming 2 May 1st 04 07:45 AM


All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"