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?
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?