Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default run module in another workbook

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



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
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Automatically Delete WorkBook 2 modules by using Workbook 1 module ddiicc Excel Programming 5 July 27th 05 12:53 PM
Copy VBA Module and Form from Workbook to another workbook topaiva Excel Programming 1 November 25th 04 03:47 PM
Workbook and Standard Module wiseman Excel Programming 3 May 29th 04 05:37 PM
Inserting Module into Workbook Nigel[_8_] Excel Programming 4 December 29th 03 03:49 PM


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