Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run VB sub from one workbook to another
I've got two workbooks, Model.xls and Shell.xls.
Model.xls contains a sub called "my_sub". It's defined as "Public Sub my_sub()". I need to open Model.xls using VBA code in Shell.xls and then run the sub "my_sub". I know how to open one file from within another, but I don't know how to call a sub. Any pointers on how to do this? -- Hmm...they have the Internet on COMPUTERS now! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run VB sub from one workbook to another
Thanks - I knew it was something simple.
-- Hmm...they have the Internet on COMPUTERS now! "Gary''s Student" wrote: Consider: Sub MDW() ActiveWorkbook.FollowHyperlink Address:="file:///c:\model.xls" Application.Run "Model.xls!my_sub" End Sub The FollowHyperlinks will open the file if not already open. -- Gary''s Student gsnu200712 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run VB sub from one workbook to another
Consider:
Sub MDW() ActiveWorkbook.FollowHyperlink Address:="file:///c:\model.xls" Application.Run "Model.xls!my_sub" End Sub The FollowHyperlinks will open the file if not already open. -- Gary''s Student gsnu200712 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook | Excel Programming | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |