2 Replies Latest reply on Nov 29, 2013 7:20 AM by peter_festesen

    DxD menu object too late when DxD launched from Expedtion

    jayson.h.harames

      I am calling a script on DxD start up that adds a custom item to the tools menu.  All is fine if DxD is started from the PRJ.  If it is launched from Expedition I get an error beacuse the command bar doesnt exsist yet. I am unsure the best way to fix the problem. 

      here is what I have.

       

        On Error Resume next 

         Set oCmdBarMenuItem = CommandBars("Sheet Menu Bar").Controls.Item("&Tools")

      If Err.Number <>0 Then

         msgerror

       

          else

          Set oButton = oCmdBarMenuItem.Controls.Add(cmdControlButton,,, 1)

          oButton.Caption = "DxD_BomGen" 

       

          oButton.OnAction = "RUN BomGen_DxD.vbs"

      End if

       

       

      Function msgerror ()

       

       

      End function