Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Calling a Public Subroutine in a Different Workbook

I have a public subroutine called routine1() located in in workbook called
Routines.xls and I would like to call routine1() from another workbook called
Book1.xls. What is the proper syntax or methodology for doing this? I'm
missing something.....

Thanks in advance,
Raul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Calling a Public Subroutine in a Different Workbook

To run a sub use:
Application.Run "WorkbookName!MacroName"
To run a function use:
ReturnValue = Application.Run("WorkbookName!MacroName")

You can add any arguments that your functions call after the macro
name. The relevant xl file will have to be open though.

Hope that helps,
Andrew


Raul wrote:
I have a public subroutine called routine1() located in in workbook called
Routines.xls and I would like to call routine1() from another workbook called
Book1.xls. What is the proper syntax or methodology for doing this? I'm
missing something.....

Thanks in advance,
Raul


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Calling a Public Subroutine in a Different Workbook

That did the trick.

Thank you very much,
Raul

" wrote:

To run a sub use:
Application.Run "WorkbookName!MacroName"
To run a function use:
ReturnValue = Application.Run("WorkbookName!MacroName")

You can add any arguments that your functions call after the macro
name. The relevant xl file will have to be open though.

Hope that helps,
Andrew


Raul wrote:
I have a public subroutine called routine1() located in in workbook called
Routines.xls and I would like to call routine1() from another workbook called
Book1.xls. What is the proper syntax or methodology for doing this? I'm
missing something.....

Thanks in advance,
Raul



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
Subroutine question and public variables musictech Excel Programming 1 July 1st 05 09:29 PM
calling a subroutine outside a spreadsheet dino Excel Programming 5 June 11th 04 06:14 PM
Function Calling Subroutine Curare Excel Programming 1 February 24th 04 07:11 PM
Public subroutine called from a private sub Neil Bhandar[_2_] Excel Programming 1 January 15th 04 10:23 PM
Calling the Solver via a subroutine James[_8_] Excel Programming 1 July 10th 03 01:08 AM


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