Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Reference code in another workbook from a calling workbook

Is there a way to reference or call code from one workbook to another?

Example

Workbook1 had a module called Mod1 and a sub called Sub1
Workbook2 had a module called Mod2 and a sub called Sub2


Can sub1 call sub2

Sub CallAcrossWorkbooks()
Call workbooks(€œBook2€).modules(€œMod2€).Procedu re(€œSub2€)

End Sub

Thanks in advance,

Stewart
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Reference code in another workbook from a calling workbook

If both workbooks are open:

application.run "book2.xls!mod2.sub2"



Datasort wrote:

Is there a way to reference or call code from one workbook to another?

Example

Workbook1 had a module called Mod1 and a sub called Sub1
Workbook2 had a module called Mod2 and a sub called Sub2

Can sub1 call sub2

Sub CallAcrossWorkbooks()
Call workbooks(€œBook2€).modules(€œMod2€).Procedu re(€œSub2€)

End Sub

Thanks in advance,

Stewart


--

Dave Peterson
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
Calling macros in another workbook Nick Wright Excel Worksheet Functions 1 January 12th 06 04:03 PM
copy and paste using code from workbook to workbook bigdaddy3 Excel Discussion (Misc queries) 2 September 14th 05 11:06 AM
What workbook is calling the function Pierre Laporte Excel Programming 2 July 15th 04 04:53 PM
calling sub from another workbook James[_9_] Excel Programming 1 October 14th 03 06:06 PM
Calling macros from another XL Workbook jamesa Excel Programming 1 October 2nd 03 03:06 PM


All times are GMT +1. The time now is 03:29 PM.

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"