Problem Populating Custom Menu in Project

J

jsl

I had asked this question over in the project.developer group to no
avail.

I have some VBA code to put a new drop-down menu on the main menu bar.
I want this menu to have 6 options. Using the example in the SDK, I
wrote the following code.

If Not foundFlag Then
Set cmbNewMenu = Application.CommandBars("Menu Bar")
With cmbNewMenu.Controls
Set ctlPopup = .Add(Type:=msoControlPopup, Temporary:=True)
With ctlPopup
.Caption = "My Options"

With .Controls.Add
.Caption = "Check-Out a file"
.TooltipText = "Check Out a Schedule"
.OnAction = "CheckoutFile"
End With
With .Controls.Add
.Caption = "Check-In File"
.TooltipText = "Check in a Schedule"
.OnAction = "CheckIn_File"
End With
With .Controls.Add
.Caption = "Copy Resource Names"
.TooltipText = "Copy Resource Names to Formatted Field"
.OnAction = "CopyResourceNamestoTextField"
End With
With .Controls.Add
.Caption = "Create Successors File"
.TooltipText = "Create Excel Successors File from
Current Schedule"
.OnAction = "TraverseSucc"
End With
With .Controls.Add
.Caption = "Set Custom Flag Fields"
.TooltipText = "Set Custom Flags in Current Schedule"
.OnAction = "SetFlagsForFilteredTasks"
End With
With .Controls.Add
.Caption = "Create Logic Report"
.TooltipText = "Create Logic Report Spreadsheet"
.OnAction = "MakeLagReport"
End With
End With
End With
End If

I also set it up in as an auto-run using project_open.

Everything appears to work fine EXCEPT only the first 4 options of my
menu show up. The last 2 don't, when it's run as an Auto_run.

If I delete the menu and run the macro from inside the VBE, everything
works like a champ.

Is there something strange when I have this code as an auto_run to run
via Project_open vs. inside of the VBE?
 

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