Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
monthly cycle events to add to calendar object jforbes Excel Discussion (Misc queries) 7 October 8th 07 08:35 PM
Using Events with the Application Object & XL 2003 Kevin H. Stecyk[_2_] Excel Programming 13 January 25th 05 04:40 PM
Late Bound Object Click Events AWesner Excel Programming 7 December 24th 04 05:39 PM
Automation Events AA2e72E[_2_] Excel Programming 4 May 27th 04 03:33 PM
XL2000: Shape object events GSQUARED Excel Programming 1 October 22nd 03 05:15 PM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"