Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Use event to catch the running of a macro from an add-in

Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?

For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.

Is this possible?
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Use event to catch the running of a macro from an add-in



First thing I would try is to see if you can determine the name of the
sub called by the Download menu item... View (menu) | Tools | Customize
and right-click the menu item and see what "assign macro" tells you.

If that works then substitute your own sub for the one assigned to the menu item.
'--
Sub MySubstitue()
On Error GoTo BadChoice
Application.EnableEvents = False
Call MacroAssignedToMenuItem
BadChoice:
Application.EnableEvents = True
End Sub
--

Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?

For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.

Is this possible?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Use event to catch the running of a macro from an add-in

No luck - any other ideas?

Thanks

On May 6, 10:21 am, "Jim Cone" wrote:
First thing I would try is to see if you can determine the name of the
sub called by the Download menu item... View (menu) | Tools | Customize
and right-click the menu item and see what "assign macro" tells you.

If that works then substitute your own sub for the one assigned to the menu item.
'--
Sub MySubstitue()
On Error GoTo BadChoice
Application.EnableEvents = False
Call MacroAssignedToMenuItem
BadChoice:
Application.EnableEvents = True
End Sub
--

Jim Cone
Portland, Oregon USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


wrote in message
Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?

For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.

Is this possible?
Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Use event to catch the running of a macro from an add-in


I failed to renew my psychic hotline subscription.
No luck means what? ...
Couldn't find a macro name? or the MySubstitute sub failed at the "something"
line with a "description here" error? or Excel crashed? or ...
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




wrote in message
No luck - any other ideas?
Thanks


On May 6, 10:21 am, "Jim Cone"
wrote:
First thing I would try is to see if you can determine the name of the
sub called by the Download menu item... View (menu) | Tools | Customize
and right-click the menu item and see what "assign macro" tells you.

If that works then substitute your own sub for the one assigned to the menu item.
'--
Sub MySubstitute()
On Error GoTo BadChoice
Application.EnableEvents = False
Call MacroAssignedToMenuItem
BadChoice:
Application.EnableEvents = True
End Sub
--

Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




wrote in message
Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?

For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.

Is this possible?
Thanks


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Use event to catch the running of a macro from an add-in

As far as I know there's no way to put a "watch" on a particular macro so
you can know when it runs (and any watching code could not run at the same
time as the watched macro...)

If you just want to make the 3rd party code complete more quickly then you
could wrap a call to it in another sub and call it via that.

Eg:

Sub Wrapper()
application.enableevents=false
application.run ThirdPartyMacroName
application.enableevents=true
end sub

However if the 3rd party macro switches event handling back on you can't
prevent that. Also, if it operates asynchronously your timing will be off.

Tim


wrote in message
...
Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?

For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.

Is this possible?
Thanks





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Use event to catch the running of a macro from an add-in

No luck meaning that I can't see the name of the sub. The macro is
called by a dll so I don't know how to figure out what call that is.
I am guessing it just isn't possible.

Thanks

On May 6, 2:50 pm, "Jim Cone" wrote:
I failed to renew my psychic hotline subscription.
No luck means what? ...
Couldn't find a macro name? or the MySubstitute sub failed at the "something"
line with a "description here" error? or Excel crashed? or ...
--
Jim Cone
Portland, Oregon USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


wrote in message
No luck - any other ideas?
Thanks

On May 6, 10:21 am, "Jim Cone"

wrote:
First thing I would try is to see if you can determine the name of the
sub called by the Download menu item... View (menu) | Tools | Customize
and right-click the menu item and see what "assign macro" tells you.


If that works then substitute your own sub for the one assigned to the menu item.
'--
Sub MySubstitute()
On Error GoTo BadChoice
Application.EnableEvents = False
Call MacroAssignedToMenuItem
BadChoice:
Application.EnableEvents = True
End Sub
--


Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



wrote in message
Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?


For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.


Is this possible?
Thanks


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Use event to catch the running of a macro from an add-in

Maybe, but it still all starts by clicking the "Download" menu item.
So run your own sub when you want to "download"...
'--
Sub MakeItHappen
On Error GoTo Snafu
Application.EnableEvents = False
Application.CommandBars(1).Controls("Custom").Cont rols("Download").Execute
Snafu:
Application.EnableEvents = True
End Sub
'--
Above assumes the Custom menu is on the menu bar.
Also, as Tim Williams pointed, out that you can't control whether the
Download routine switches Events back on or when it finishes.
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)






wrote in message
No luck meaning that I can't see the name of the sub. The macro is
called by a dll so I don't know how to figure out what call that is.
I am guessing it just isn't possible.
Thanks

On May 6, 2:50 pm, "Jim Cone"
wrote:
I failed to renew my psychic hotline subscription.
No luck means what? ...
Couldn't find a macro name? or the MySubstitute sub failed at the "something"
line with a "description here" error? or Excel crashed? or ...
--
Jim Cone
Portland, Oregon USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
No luck - any other ideas?
Thanks




On May 6, 10:21 am, "Jim Cone"
wrote:
First thing I would try is to see if you can determine the name of the
sub called by the Download menu item... View (menu) | Tools | Customize
and right-click the menu item and see what "assign macro" tells you.
If that works then substitute your own sub for the one assigned to the menu item.
'--
Sub MySubstitute()
On Error GoTo BadChoice
Application.EnableEvents = False
Call MacroAssignedToMenuItem
BadChoice:
Application.EnableEvents = True
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
Is there a way to determine when a macro from a 3rd-party add-in has
started running and when it has finished?


For example, lets say I have a 3rd party add-in that downloads data
from the internet and has a custom menu called Custom with a submenu
called Download. If I select download I would like to "catch" that it
was called and set application.enableevents to false and then whenever
it is done I would like to turn it back on.
Is this possible?
Thanks


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
catch event Nader Tewelde Excel Programming 2 June 22nd 07 07:59 PM
catch event insert a row or delete a row Nader Excel Programming 2 July 21st 06 06:38 AM
Catch column width event. Artem Omelianchuk Excel Programming 2 June 3rd 05 06:01 PM
How do I 'catch' a 'delete cells' event Eric Excel Discussion (Misc queries) 2 March 9th 05 07:22 PM
Catch drop event in excel Edi Excel Programming 1 February 20th 05 05:26 PM


All times are GMT +1. The time now is 04:40 PM.

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

About Us

"It's about Microsoft Excel"