Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Setting OnAction Property Fails

I have an add-in that works just fine when there is a single instance of it
running on a particular machine.

However, if two copies get launched at essentially the same time on the same
machine, I get the following error:

Method 'OnAction' of object '_CommandBarButton' failed.

The runtime error number is 80004005. The failing line of code looks like
this:

Dim cmdButton As CommandBarButton

cmdButton.OnAction = "SomeMacroName"

Again, the assignment statement and the resulting toolbar button work just
fine when a single instance of Excel and the add-in is running ... the error
only happens when two copies are started at the same time.

Any thoughts?

Do multiple copies of Excel share something that's causing this problem?

BTW, am running XL2003.

TIA,

josh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Setting OnAction Property Fails

My question is how are you getting two instances of the addin running on one
machine concurrently? Solve that and the problems go away... Is the addin
installed through code?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

I have an add-in that works just fine when there is a single instance of it
running on a particular machine.

However, if two copies get launched at essentially the same time on the same
machine, I get the following error:

Method 'OnAction' of object '_CommandBarButton' failed.

The runtime error number is 80004005. The failing line of code looks like
this:

Dim cmdButton As CommandBarButton

cmdButton.OnAction = "SomeMacroName"

Again, the assignment statement and the resulting toolbar button work just
fine when a single instance of Excel and the add-in is running ... the error
only happens when two copies are started at the same time.

Any thoughts?

Do multiple copies of Excel share something that's causing this problem?

BTW, am running XL2003.

TIA,

josh



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Setting OnAction Property Fails

Jim,

We're actually running multiple instances of Excel and the add-in
intentionally. We have a non-Excel process runs on a server and that reads
messages off of a queue. Depending on the content of each message this
process spawns off a copy of Excel with command line arguments that are
based on the message content.

So we want to make this work.

The add-in isn't added by code.

josh



"Jim Thomlinson" wrote in message
...
My question is how are you getting two instances of the addin running on
one
machine concurrently? Solve that and the problems go away... Is the addin
installed through code?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

I have an add-in that works just fine when there is a single instance of
it
running on a particular machine.

However, if two copies get launched at essentially the same time on the
same
machine, I get the following error:

Method 'OnAction' of object '_CommandBarButton' failed.

The runtime error number is 80004005. The failing line of code looks
like
this:

Dim cmdButton As CommandBarButton

cmdButton.OnAction = "SomeMacroName"

Again, the assignment statement and the resulting toolbar button work
just
fine when a single instance of Excel and the add-in is running ... the
error
only happens when two copies are started at the same time.

Any thoughts?

Do multiple copies of Excel share something that's causing this problem?

BTW, am running XL2003.

TIA,

josh





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Setting OnAction Property Fails

Multiple instances of excel running should not (to the best of my knowledge)
cause any difficulty. Each one resides in it's own world and does not
interact with other instances. In any one instance of Excel do you have the
addin running more than once (I might be a little slow on the uptake but I
could not determine that from your post)?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

Jim,

We're actually running multiple instances of Excel and the add-in
intentionally. We have a non-Excel process runs on a server and that reads
messages off of a queue. Depending on the content of each message this
process spawns off a copy of Excel with command line arguments that are
based on the message content.

So we want to make this work.

The add-in isn't added by code.

josh



"Jim Thomlinson" wrote in message
...
My question is how are you getting two instances of the addin running on
one
machine concurrently? Solve that and the problems go away... Is the addin
installed through code?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

I have an add-in that works just fine when there is a single instance of
it
running on a particular machine.

However, if two copies get launched at essentially the same time on the
same
machine, I get the following error:

Method 'OnAction' of object '_CommandBarButton' failed.

The runtime error number is 80004005. The failing line of code looks
like
this:

Dim cmdButton As CommandBarButton

cmdButton.OnAction = "SomeMacroName"

Again, the assignment statement and the resulting toolbar button work
just
fine when a single instance of Excel and the add-in is running ... the
error
only happens when two copies are started at the same time.

Any thoughts?

Do multiple copies of Excel share something that's causing this problem?

BTW, am running XL2003.

TIA,

josh






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Setting OnAction Property Fails

No ... a single copy of the add-in in each instance of Excel.

At startup, the add-in creates a few toolbars and puts a number of buttons
on each one. So there is a period where maybe 20 or 30 toolbar buttons,
shortcut menu's, etc have their OnAction property set. And this is where it
blows it brains out.

josh



"Jim Thomlinson" wrote in message
...
Multiple instances of excel running should not (to the best of my
knowledge)
cause any difficulty. Each one resides in it's own world and does not
interact with other instances. In any one instance of Excel do you have
the
addin running more than once (I might be a little slow on the uptake but I
could not determine that from your post)?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

Jim,

We're actually running multiple instances of Excel and the add-in
intentionally. We have a non-Excel process runs on a server and that
reads
messages off of a queue. Depending on the content of each message this
process spawns off a copy of Excel with command line arguments that are
based on the message content.

So we want to make this work.

The add-in isn't added by code.

josh



"Jim Thomlinson" wrote in message
...
My question is how are you getting two instances of the addin running
on
one
machine concurrently? Solve that and the problems go away... Is the
addin
installed through code?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

I have an add-in that works just fine when there is a single instance
of
it
running on a particular machine.

However, if two copies get launched at essentially the same time on
the
same
machine, I get the following error:

Method 'OnAction' of object '_CommandBarButton' failed.

The runtime error number is 80004005. The failing line of code looks
like
this:

Dim cmdButton As CommandBarButton

cmdButton.OnAction = "SomeMacroName"

Again, the assignment statement and the resulting toolbar button work
just
fine when a single instance of Excel and the add-in is running ... the
error
only happens when two copies are started at the same time.

Any thoughts?

Do multiple copies of Excel share something that's causing this
problem?

BTW, am running XL2003.

TIA,

josh










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Setting OnAction Property Fails

It sound like you are creating and destroying the toolbar at the workbook
open events. I assume you are destroying the toolbar when you are done.
Instead of using this even try using the AddinInstall event something like
this... This way your toolbar does not need to be loaded each time and
perhaps your onaction will not have the conflict.

Private Sub Workbook_AddinInstall()
Call CreateMyToolbar
End Sub

Private Sub Workbook_AddinUninstall()
Call DestroyMyToolbar
End Sub
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

No ... a single copy of the add-in in each instance of Excel.

At startup, the add-in creates a few toolbars and puts a number of buttons
on each one. So there is a period where maybe 20 or 30 toolbar buttons,
shortcut menu's, etc have their OnAction property set. And this is where it
blows it brains out.

josh



"Jim Thomlinson" wrote in message
...
Multiple instances of excel running should not (to the best of my
knowledge)
cause any difficulty. Each one resides in it's own world and does not
interact with other instances. In any one instance of Excel do you have
the
addin running more than once (I might be a little slow on the uptake but I
could not determine that from your post)?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

Jim,

We're actually running multiple instances of Excel and the add-in
intentionally. We have a non-Excel process runs on a server and that
reads
messages off of a queue. Depending on the content of each message this
process spawns off a copy of Excel with command line arguments that are
based on the message content.

So we want to make this work.

The add-in isn't added by code.

josh



"Jim Thomlinson" wrote in message
...
My question is how are you getting two instances of the addin running
on
one
machine concurrently? Solve that and the problems go away... Is the
addin
installed through code?
--
HTH...

Jim Thomlinson


"Josh Sale" wrote:

I have an add-in that works just fine when there is a single instance
of
it
running on a particular machine.

However, if two copies get launched at essentially the same time on
the
same
machine, I get the following error:

Method 'OnAction' of object '_CommandBarButton' failed.

The runtime error number is 80004005. The failing line of code looks
like
this:

Dim cmdButton As CommandBarButton

cmdButton.OnAction = "SomeMacroName"

Again, the assignment statement and the resulting toolbar button work
just
fine when a single instance of Excel and the add-in is running ... the
error
only happens when two copies are started at the same time.

Any thoughts?

Do multiple copies of Excel share something that's causing this
problem?

BTW, am running XL2003.

TIA,

josh









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
Setting CommandText property of PivotCache fails if cache has 1 PivotTable ashortxl Excel Programming 1 May 20th 05 10:27 PM
.ONACTION macro call fails Wayne Excel Discussion (Misc queries) 2 March 2nd 05 05:10 PM
Propblem setting OnAction property at runtime Philip Excel Programming 2 January 26th 04 05:51 PM
Find OnAction property Kemosabe Excel Programming 1 November 21st 03 03:34 PM


All times are GMT +1. The time now is 02:02 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"