Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default .OnAction points to wrong file.module.procedure

I have a problem with a reference for the .OnAction of a command bar button.

There are two excel workbooks open. One is an XLA that is the code for the
other workbook. In each workbook there is a module called reports and a sub
called GenerateReports. The full index to the code is Reports.GenerateReports

The workbooks are names.

Plan1.xls
PlanCode.xla


The OnAction is set to the code below:

.. OnAction = PlanCode.xla!Reports.GenerateReports


The problem is that the code that is being run is.

Plan1.xls!Reports.GenerateReports not the .XLA file.

I cant seem to run the code in the xla version or Reports.GenerateReports

Other considerations:

The .xla file has the property isAddIn is set to true. Thus the workbook in
not visible.

I would also prefer not to rename either Module.Procedure name

I am running Office10 (Excel XP)

Any thought/solutions would be appreciated

--
Stewart Rogers
DataSort Software, L.C.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default .OnAction points to wrong file.module.procedure

Hi Stewart,

Unfortunately, this is a known problem with the OnAction setting of
command bar controls. If two workbooks have the same procedure name, a
command bar control with its OnAction property assigned to that procedure
name will run the procedure in which ever workbook was opened last.
Qualifying the procedure name with the workbook name when setting the
OnAction property doesn't help. The only workaround is to make sure your
procedures are uniquely named.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

"Datasort" wrote in message
...
I have a problem with a reference for the .OnAction of a command bar
button.

There are two excel workbooks open. One is an XLA that is the code for the
other workbook. In each workbook there is a module called reports and a
sub
called GenerateReports. The full index to the code is
Reports.GenerateReports

The workbooks are names.

Plan1.xls
PlanCode.xla


The OnAction is set to the code below:

. OnAction = PlanCode.xla!Reports.GenerateReports


The problem is that the code that is being run is.

Plan1.xls!Reports.GenerateReports not the .XLA file.

I can't seem to run the code in the xla version or Reports.GenerateReports

Other considerations:

The .xla file has the property isAddIn is set to true. Thus the workbook
in
not visible.

I would also prefer not to rename either Module.Procedure name

I am running Office10 (Excel XP)

Any thought/solutions would be appreciated

--
Stewart Rogers
DataSort Software, L.C.



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
to call procedure in a worksheet in a module CAPTGNVR Excel Discussion (Misc queries) 4 January 30th 07 09:39 PM
Add Procedure To Module Via VBA Al Excel Programming 2 May 20th 05 10:58 PM
OnAction procedure Max Potters Excel Programming 4 September 26th 04 07:58 PM
programmatically open VBE and go to a specified procedure in target module? DataFreakFromUtah Excel Programming 4 July 12th 04 05:37 PM
Lines in a Module(Procedure) Juan Melero Excel Programming 6 December 30th 03 12:38 AM


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