Good Morning Everyone,
I'm missing something very simple here I think, I'm pretty sure on the launch this is calling for the program to make the toolbar again which is giving me the error. here is the code I am working with, if anyone knows how to get around this error please let me know.
"
Sub Auto_Open()
Dim My_Menu As CommandBar, newControl, newItem, subMenu
Set My_Menu = CommandBars.Add(Name:="Oncore Modifications", Position:=msoBarTop, MenuBar:=False)
My_Menu.Visible = True
Set newControl = My_Menu.Controls.Add(Type:=msoControlPopup)
newControl.Caption = "Oncore Modifications"
With newControl
Set subMenu = .Controls.Add(Type:=msoControlPopup)
End With
With subMenu
.Caption = "Trim Spaces Functions"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Trim Left"
newItem.OnAction = "TrimL"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Trim Right"
newItem.OnAction = "TrimR"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Trim Left and Right"
newItem.OnAction = "TrimLR"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Trim Irregular Spacing"
newItem.OnAction = "TrimIrregular"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Trim All"
newItem.OnAction = "RemoveAllSpaces"
End With
With newControl
Set subMenu = .Controls.Add(Type:=msoControlPopup)
End With
With subMenu
.Caption = "Report Format Options"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "CF Backlog"
newItem.OnAction = "ONCORE_CA_BACKLOG"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Oncore OOR"
newItem.OnAction = "Oncore_OOR"
Set newItem = .Controls.Add(Type:=msoControlButton)
newItem.Caption = "Send to Michelle"
newItem.OnAction = "Send_to_Michelle"
End With
End Sub
Im pretty sure, I just need to add a line telling the program to not try to load it again once the add-in is launched but I am drawing a blank
Any help from those greater and wiser than myself is always appreciated.
Fawkes_
Bookmarks