R
Rob
Hello.
Here's the scenario... I have one workbook open and I copy specific sheets
into a new woorkbook, now both have the same macros in them, what I want to
do is use woorkbook1 to switch control to workbook2 and run a macro that is
in workbook2.
For example: Workbook1 code...
Private Sub CommandButton1_Click()
'Select Tabs and Copy
Sheets(Array("Info", "Data")).Copy
'Save New Workbook
ActiveWorkbook.SaveAs Filename:="WorkBook2.xls", FileFormat:=xlNormal,
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False
Windows("WorkBook2.xls").Activate
'Use Macro That's In WorkBook2
Call DoThis(WorkBook2.xls)
End Sub
Here's the Code in WorkBook2.xls:
Sub DoThis()
WorkBooks("WorkBook2.xls").Close
MsgBox("All Done Boss.")
End Sub
Any Ideas on this?
Thanks in Advance.
Rob
Here's the scenario... I have one workbook open and I copy specific sheets
into a new woorkbook, now both have the same macros in them, what I want to
do is use woorkbook1 to switch control to workbook2 and run a macro that is
in workbook2.
For example: Workbook1 code...
Private Sub CommandButton1_Click()
'Select Tabs and Copy
Sheets(Array("Info", "Data")).Copy
'Save New Workbook
ActiveWorkbook.SaveAs Filename:="WorkBook2.xls", FileFormat:=xlNormal,
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False
Windows("WorkBook2.xls").Activate
'Use Macro That's In WorkBook2
Call DoThis(WorkBook2.xls)
End Sub
Here's the Code in WorkBook2.xls:
Sub DoThis()
WorkBooks("WorkBook2.xls").Close
MsgBox("All Done Boss.")
End Sub
Any Ideas on this?
Thanks in Advance.
Rob