S
Sigmund
I have created an Excel Template and a macro that save it under a new name
the problem is that everytime it saves under new name the new book stays
open as well as the template; i need the template to stay open and the book
created close after saving; here is what i have so far
Sub PrintAndClear()
'
' PrintAndClear Macro
' Macro recorded 9/10/2008 by me
'
' 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
i tried adding
ActiveWorkbook.Close after the print out but it does not work it closes the
book and the template but leaves Excel running
your help will be greatly appreciated
the problem is that everytime it saves under new name the new book stays
open as well as the template; i need the template to stay open and the book
created close after saving; here is what i have so far
Sub PrintAndClear()
'
' PrintAndClear Macro
' Macro recorded 9/10/2008 by me
'
' 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
i tried adding
ActiveWorkbook.Close after the print out but it does not work it closes the
book and the template but leaves Excel running
your help will be greatly appreciated