Macro

E

Exceldude

Need a help with a Macro that save and close a file; than immediately open
onother file

Thank you
 
S

Sheeloo

Try
Sub Macro1()
Windows("Book1.xls").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
Workbooks.Open Filename:= _
"C:\Book2.xls"
Windows("Book2.xls").Activate
End Sub
Book1 should be open... Give complete path for Book2
 
E

Exceldude

Ok,
this is what I have
Sub PrintAndClear()
'
' PrintAndClear Macro
' Macro recorded 9/10/2008 by Sigi Mondragon
'
' Keyboard Shortcut: Ctrl+Shift+Q
'
response = MsgBox("Do you want to Save this to a new file?" _
, vbYesNo, "Save As")
If response = 6 Then
Name = InputBox("Enter a Filename", "Get Filename")
If Name = "" Then End
ActiveWorkbook.SaveAs Filename:="P:\" & Name & ".xls"
End If
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Workbooks.Open Filename:="P:\Calculations Sheet-2008 WSO.xls"
Range("E6").Select
End Sub

so I will like for the File Saved to Close and The Calculations Sheet-2008
to open
if I add Active Window after the printout is done it will close the files
but will not ope the Calculations Sheet
 
Top