View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
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