Hello,I just begin to write addins,I don't know much about it.I want to write an addin for Excel,But the error occured.The two Error were red ones.The code was wrote with VB2008
Name "msoControlPopup" is not declared
Name "msoControlButton" is not declared
Dim WithEvents MyButton As CommandBarButton
Private applicationObject As Object
Private addInInstance As Object
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete
Dim oCommandBars As CommandBars
Dim oStandardBar As CommandBar
Dim oBarPopup As CommandBarPopup
On Error Resume Next
oCommandBars = applicationObject.CommandBars
oStandardBar = oCommandBars.Item("Standard")
oBarPopup = oStandardBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)
oBarPopup.Caption = "COMAddIn"
MyButton = oBarPopup.Controls.Add(Type:=msoControlButton)
.Caption = "Hide and unhide worksheets"
.Style = MsoButtonStyle.msoButtonCaption
.Tag = "My Custom Button"
.OnAction = "!<MyCOMAddin.Connect>"
.Visible = True
oStandardBar = Nothing
oCommandBars = Nothing
Can anyone tell me what's wrong?