ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run macro in another file (https://www.excelbanter.com/excel-programming/325735-run-macro-another-file.html)

Steph[_5_]

Run macro in another file
 
Hi all I have a stange circumstance. In a perticular file, if a certain
event is true, I would like to open another workbook and run a procedure
within that workbook. Unfortunately, the macro that will be executed is
programmed to open the original workbook.

I'm trying to figure out how to call that macro AFTER a certain criteria is
met and AFTER the original workbook has closed. Any ideas?



Bob Phillips[_6_]

Run macro in another file
 
Check if it is already open, and if so, don't open it

On Error Resume Next
Set oWb = Workbooks("myBook.xls")
On Error Goto 0
If oWb Is Nothing Then
Workbooks.Open ...
`etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Hi all I have a stange circumstance. In a perticular file, if a certain
event is true, I would like to open another workbook and run a procedure
within that workbook. Unfortunately, the macro that will be executed is
programmed to open the original workbook.

I'm trying to figure out how to call that macro AFTER a certain criteria

is
met and AFTER the original workbook has closed. Any ideas?






All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com