+ Reply to Thread
Results 1 to 7 of 7

object does not source automation events

  1. #1
    josh7
    Guest

    object does not source automation events

    I am using visual basic 6.When I add a reference to Microsoft Excel 11.0
    object library and run the program, it gives an error

    Compile error: Object does not source automation events.

    The programs works fine when the reference is removed.I am not sure why its
    happening?




  2. #2
    Chip Pearson
    Guest

    Re: object does not source automation events

    The first thing I would try is running Excel with the /regserver
    switch, to instruct Excel to reset all its registry/typelib
    information. With Excel closed, go to the Windows Start menu,
    choose Run, and enter


    Excel.exe /regserver

    This will cause Excel to start, rewrite all of its registry
    information, and then quit. Recompile your VB6 program.
    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com




    "josh7" <[email protected]> wrote in message
    news:[email protected]...
    >I am using visual basic 6.When I add a reference to Microsoft
    >Excel 11.0
    > object library and run the program, it gives an error
    >
    > Compile error: Object does not source automation events.
    >
    > The programs works fine when the reference is removed.I am not
    > sure why its
    > happening?
    >
    >
    >




  3. #3
    josh7
    Guest

    Re: object does not source automation events

    I am using the following statement in general declarations in vb 6.0

    Private withevents ctrToolBar as Toolbar

    I tried using Excel.exe /regserver but its still giving the same error


    "Chip Pearson" wrote:

    > The first thing I would try is running Excel with the /regserver
    > switch, to instruct Excel to reset all its registry/typelib
    > information. With Excel closed, go to the Windows Start menu,
    > choose Run, and enter
    >
    >
    > Excel.exe /regserver
    >
    > This will cause Excel to start, rewrite all of its registry
    > information, and then quit. Recompile your VB6 program.
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    >
    > "josh7" <[email protected]> wrote in message
    > news:[email protected]...
    > >I am using visual basic 6.When I add a reference to Microsoft
    > >Excel 11.0
    > > object library and run the program, it gives an error
    > >
    > > Compile error: Object does not source automation events.
    > >
    > > The programs works fine when the reference is removed.I am not
    > > sure why its
    > > happening?
    > >
    > >
    > >

    >
    >
    >


  4. #4
    DM Unseen
    Guest

    Re: object does not source automation events

    Oops,

    the Toolbar object has been discontinued from XL97 onwards, pls use the
    more modern Commandbar object. It is only available in XL for backward
    compatability.

    Also the Toolbar object as given by XL typelib has no events(so
    withevents would not make any sense), The Commandbar model has some btw
    (for the individual controls and for the collection)

    DM Unseen


  5. #5
    josh7
    Guest

    Re: object does not source automation events

    The tool bar that i am using is from the windows common controls in vb 6 not
    in excel.


  6. #6
    DM Unseen
    Guest

    Re: object does not source automation events

    Then you have a typelib conflict!

    pls prefix the Toolbar type definition with the actual typelib name to
    distinguish it form the Toolbar object in the XL typelib(look it up in
    the object browser)

    e.g.

    Private withevents ctrToolBar as MyTypelib.Toolbar

    Dm Unseen


  7. #7
    josh7
    Guest

    Re: object does not source automation events

    You are right,I am having a typelib conflict
    Thank you,
    Joshua



    "DM Unseen" wrote:

    > Then you have a typelib conflict!
    >
    > pls prefix the Toolbar type definition with the actual typelib name to
    > distinguish it form the Toolbar object in the XL typelib(look it up in
    > the object browser)
    >
    > e.g.
    >
    > Private withevents ctrToolBar as MyTypelib.Toolbar
    >
    > Dm Unseen
    >
    >


+ 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