A Thayuman
New Member
- Joined
- Mar 6, 2019
- Messages
- 30
The Code below works fine I took it from one of the solved problems and Mr.Excel
However I am not sure how to change the file location to Save with as the fixed name "E-liteMaster" & ".xlsm"
And change the path shown below to :
save to "C:\Users\anil\Documents\E-lite Invoices and PDF"
I am unable to do so! May I request some advice and help please
Code that works with the existing Path is:
Sub PrintSave()
'saveprint Macro
'
'
Dim Path As String
Dim filename As String
Path = Environ$("Userprofile") & "\Inv" & " "
filename = Sheets("Invoice").Range("A5")
Sheets("Invoice").Select
ActiveWorkbook.SaveAs filename:=Path & "E-liteMaster" & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
Path & filename & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
End Sub
IgnorePrintAreas:=False
End Sub
However I am not sure how to change the file location to Save with as the fixed name "E-liteMaster" & ".xlsm"
And change the path shown below to :
save to "C:\Users\anil\Documents\E-lite Invoices and PDF"
I am unable to do so! May I request some advice and help please
Code that works with the existing Path is:
Sub PrintSave()
'saveprint Macro
'
'
Dim Path As String
Dim filename As String
Path = Environ$("Userprofile") & "\Inv" & " "
filename = Sheets("Invoice").Range("A5")
Sheets("Invoice").Select
ActiveWorkbook.SaveAs filename:=Path & "E-liteMaster" & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
Path & filename & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
End Sub
IgnorePrintAreas:=False
End Sub