+ Reply to Thread
Results 1 to 3 of 3

Command bar diclaration

  1. #1
    Registered User
    Join Date
    10-19-2005
    Posts
    38

    Question Command bar diclaration

    Hi All,

    How to declare commandbar in visual basic6.0

    in excel visual basic editor iam declaring as

    Dim oCB As Commandbar

    i declare same as above but it is saying

    Compile error:
    User-Defined type not defined error is coming.

    How we have to declare in visual basic.

    Thanks&Regards,
    Amar...

  2. #2
    Patrick Molloy
    Guest

    RE: Command bar diclaration

    assuming that you have a reference set to th eexcel objects library

    Dim xl As Excel.Application
    Dim wb As Excel.Workbook
    Dim oCB As Object

    Set xl = New Excel.Application
    xl.Visible = True
    Set oCB = xl.CommandBars.Add("test")
    oCB.Visible = True



    "areddy" wrote:

    >
    > Hi All,
    >
    > How to declare commandbar in visual basic6.0
    >
    > in excel visual basic editor iam declaring as
    >
    > Dim oCB As Commandbar
    >
    > i declare same as above but it is saying
    >
    > Compile error:
    > User-Defined type not defined error is coming.
    >
    > How we have to declare in visual basic.
    >
    > Thanks&Regards,
    > Amar...
    >
    >
    > --
    > areddy
    > ------------------------------------------------------------------------
    > areddy's Profile: http://www.excelforum.com/member.php...o&userid=28204
    > View this thread: http://www.excelforum.com/showthread...hreadid=482716
    >
    >


  3. #3
    Tushar Mehta
    Guest

    Re: Command bar diclaration

    In XL VBE check the established references (Tools | References...)
    That should tell you which library your VB code should reference to use
    early binding with commandbars.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    >
    > Hi All,
    >
    > How to declare commandbar in visual basic6.0
    >
    > in excel visual basic editor iam declaring as
    >
    > Dim oCB As Commandbar
    >
    > i declare same as above but it is saying
    >
    > Compile error:
    > User-Defined type not defined error is coming.
    >
    > How we have to declare in visual basic.
    >
    > Thanks&Regards,
    > Amar...
    >
    >
    > --
    > areddy
    > ------------------------------------------------------------------------
    > areddy's Profile: http://www.excelforum.com/member.php...o&userid=28204
    > View this thread: http://www.excelforum.com/showthread...hreadid=482716
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1