Hello all,
I am trying to print to a pdf specific worksheets to a predefined filename (from cell value) and path. When I run this, the correct worksheets are selected however I still get the popup window to enter the filename. I would like this to save the selected worksheets to pdf without having to enter any details manually. Any guidance will be greatly appreciated.
Sub print()
Dim FName As String
Dim FPath As String
FName = Sheets("Project Description").Range("L3")
FPath = "C:\Effort Assessments\" & FName & ".pdf"
On Error GoTo ErrMsg
Sheets(Array("Concept Definition", "Design & Architecture", _
"Component Development", "Integration", "Validation", "Feature Owners", _
"Product Management")).Select
Sheets("Concept Definition").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False, prtofilename:=FPath
Exit Sub
ErrMsg:
MsgBox ("Group reports not created. Generate group reports and try again."), , "Export Error"
End Sub
I am trying to print to a pdf specific worksheets to a predefined filename (from cell value) and path. When I run this, the correct worksheets are selected however I still get the popup window to enter the filename. I would like this to save the selected worksheets to pdf without having to enter any details manually. Any guidance will be greatly appreciated.
Sub print()
Dim FName As String
Dim FPath As String
FName = Sheets("Project Description").Range("L3")
FPath = "C:\Effort Assessments\" & FName & ".pdf"
On Error GoTo ErrMsg
Sheets(Array("Concept Definition", "Design & Architecture", _
"Component Development", "Integration", "Validation", "Feature Owners", _
"Product Management")).Select
Sheets("Concept Definition").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False, prtofilename:=FPath
Exit Sub
ErrMsg:
MsgBox ("Group reports not created. Generate group reports and try again."), , "Export Error"
End Sub