J
Jim A
Hi - I have a "save as" macro that I would like to incorporate with my "print
to XPS" macro. Can anybody help?
I have this code:
'' Save to XPS ''''''''''''''''''''''''''''
Application.ActivePrinter = "Microsoft XPS Document Writer on Ne01:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Credit History").PrintOut Copies:=1
Application.ActivePrinter = "HP LaserJet P1505n on Ne02:"
'''''''''''''''''''''''''''''''''''''''''''''''''''''
BUT I would like the macro to "save as" like this macro:
'''''''''''''''''Save To Path Code'''''''''''''''''''''''
Dim sPath As String
Dim y1 As String, n1 As String
On Error Resume Next 'overcoming the error when a direcory already
exists for MkDir sPath
y1 = Sheets("1").Range("N1").Value
n1 = Sheets("1").Range("B1").Value
sPath = "D:\Ayers My Docs\AHS\AHS Credit Spreadsheets\" & n1 & " " & y1
'make Dir if NOT already there
MkDir sPath
''''''''''''''''''''''' SaveAs Code '''''''''''''''''''''''''''
ActiveWorkbook.SaveCopyAs sPath & "\" & y1 & Format(Now, " mmm-dd-yy
hhmmss") & ".xlsm"
MsgBox "Workbook Saved As '" & y1 & "' in folder '" & sPath & "'."
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
How can I print to XPS saving with the same parameters as the above "save
as" macro?
Thanks for any help - Jim A
to XPS" macro. Can anybody help?
I have this code:
'' Save to XPS ''''''''''''''''''''''''''''
Application.ActivePrinter = "Microsoft XPS Document Writer on Ne01:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Credit History").PrintOut Copies:=1
Application.ActivePrinter = "HP LaserJet P1505n on Ne02:"
'''''''''''''''''''''''''''''''''''''''''''''''''''''
BUT I would like the macro to "save as" like this macro:
'''''''''''''''''Save To Path Code'''''''''''''''''''''''
Dim sPath As String
Dim y1 As String, n1 As String
On Error Resume Next 'overcoming the error when a direcory already
exists for MkDir sPath
y1 = Sheets("1").Range("N1").Value
n1 = Sheets("1").Range("B1").Value
sPath = "D:\Ayers My Docs\AHS\AHS Credit Spreadsheets\" & n1 & " " & y1
'make Dir if NOT already there
MkDir sPath
''''''''''''''''''''''' SaveAs Code '''''''''''''''''''''''''''
ActiveWorkbook.SaveCopyAs sPath & "\" & y1 & Format(Now, " mmm-dd-yy
hhmmss") & ".xlsm"
MsgBox "Workbook Saved As '" & y1 & "' in folder '" & sPath & "'."
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
How can I print to XPS saving with the same parameters as the above "save
as" macro?
Thanks for any help - Jim A