"cann't find project or library" error
i try to create a simple command bar with some command bar buttons in VBA (outlook). and i got "cann't find project or library" error on:
Dim cbTesting As CommandBar
Dim ctlCBarButton As CommandBarButton
the VBA editor doen't recognize the CommandBar and CommandBarButton objects :(
Can you plz tell what have i done wrong this time..
10x
Re: "cann't find project or library" error
Quote:
Originally Posted by nastya
i try to create a simple command bar with some command bar buttons in VBA (outlook). and i got "cann't find project or library" error on:
Dim cbTesting As CommandBar
Dim ctlCBarButton As CommandBarButton
the VBA editor doen't recognize the CommandBar and CommandBarButton objects :(
Can you plz tell what have i done wrong this time..
10x
I am not 100% shure but, try this it should work:
VB Code:
Dim cbTesting As Object
Dim ctlCBarButton As Object
Set cbTesting = CreateObject("Outlook.CommandBar")
Set ctlCBarButton = CreateObject("Outlook.CommandBarButton")
Like I said I'm not 100% shure and do not have Outlook to test it :)
Cheers,
RyanJ
Re: "cann't find project or library" error
You need to reference the parent object first just in the declarations.
VB Code:
Dim cbTesting As Office.CommandBar
Dim ctlCBarButton As Office.CommandBarButton