Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Run method for subroutines

Hello,

I have a master workbook(1) that opens a second
workbook(2) and I would like to call a subroutine in
workbook(2) from workbook(1). The subroutine will perform
calculations in workbook(2).

I have found a way to do this by manually setting a
reference to workbook(2) in workbook(1), but I'd like to
do it without adding a reference.

When I use the line:

Application.Run("CC.xla!Calculateconfig",var1,var2 )

I get an error saying it expects an “=”.

The subroutine I’m trying to call is in a workbook
called “CC.xla”, the “ThisWorkbook” module, and is
named “Calculateconfig”.

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run method for subroutines

Take the routine out of the ThisWorkbookModule and put it in a general
module.

Then it should work.

You should only put event code in the ThisWorkbook and sheet modules as a
general rule.

--
Regards,
Tom Ogilvy

"Scott" wrote in message
...
Hello,

I have a master workbook(1) that opens a second
workbook(2) and I would like to call a subroutine in
workbook(2) from workbook(1). The subroutine will perform
calculations in workbook(2).

I have found a way to do this by manually setting a
reference to workbook(2) in workbook(1), but I'd like to
do it without adding a reference.

When I use the line:

Application.Run("CC.xla!Calculateconfig",var1,var2 )

I get an error saying it expects an “=”.

The subroutine I’m trying to call is in a workbook
called “CC.xla”, the “ThisWorkbook” module, and is
named “Calculateconfig”.

Any suggestions?


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
turn off subroutines NDBC Excel Discussion (Misc queries) 3 July 27th 09 01:23 PM
VBA - passing Variables to subroutines Madduck Excel Discussion (Misc queries) 12 September 19th 08 03:20 AM
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
best method Tim Excel Discussion (Misc queries) 1 October 17th 05 10:05 AM


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