Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro in File01.xls that opens File02.xls and then does an
Appliction.Run on the Auto_Open macro in File02.xls: Private Sub MacroOpenFile02() Workbooks.Open Filename:= "C:\File02.xls", Password:="aoaoao" Application.Run "'C:\File02.xls'!Auto_Open" Windows("File01.xls").Close (0) End Sub Now when the macro Application.Run "'C:\File02.xls'!Auto_Open" runs there is a test in the code that depeding on the result, I may close the file with Windows("File02.xls").Close(0) ; Now it returns back to continue in macro in File01.xls I think but I want to put up a message saying File02.xls has an error and cannot be open. I have made it work in File02.xls by putting the MsgBox code line right before the Close(0) code line. But that means File02.xls is open behind the MsgBox. When the user clicks ok on the MsgBox it closes the file, but what I want is if there was an error for File02.xls, that it closes so the user will not see File02.xls ... and then return to File01.xls macro and show a MsgBox from File01.xls macro. How do I accomplish this? Thank you, Steven |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Show a message but not in MsgBox | Excel Discussion (Misc queries) | |||
message box does not show | Excel Discussion (Misc queries) | |||
If A0, I need a message pop-up box to show text in B1 | Excel Programming | |||
Message box to show cell value | Excel Programming | |||
show message | Excel Programming |