View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default run module in another workbook

Here is an example from my workbook named NCP Work.xls. It will open (NCP
Tracking.xls) and run a macro (RunUpdate) in that workbook that is in the
same folder path.

Sub RunTracking()
Dim cdir As String
Dim wb As Workbook

For Each wb In Workbooks
If wb.name = "NCP Tracking.xls" Then
MsgBox ("NCP Tracking.xls is already open.")
Exit Sub
End If
Next wb
cdir = ActiveWorkbook.Path
Workbooks.Open cdir & "\NCP Tracking.xls", password:="NCP"
Application.Run ("'NCP Tracking.xls'!RunUpdate")
End Sub

Mike F
"geebee" (noSPAMs) wrote in message
...
hi,

I have a Sub Option_Change() in a module called OptionChanger. I would
like
to know how I can refer to this module and run it from another workbook?

Thanks in advance,
geebee