When the code below is executed it prompts the user to choose the location they want to save on their computer (also inputs a default filename from values in the sheet) and prints the range to PDF.
The problem is... I now need to save to Excel instead. I have been playing with different solutions to save the worksheet to a new workbook, but can not find one that prompts the user to save as. Also, I have a couple of buttons on the sheet that activate macros. I would like to delete/hide these in the new workbook.
Any suggestions would be greatly appreciated!
Code:
Worksheets("Sheet1").Activate
filename = Application.GetSaveAsFilename(InitialFileName:=Sheets("Sheet1").Range("K3").Value, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Path and Filename to save")
If filename <> "False" Then
With ActiveWorkbook
.Worksheets("Sheet1").Range("A1:I119").ExportAsFixedFormat Type:=xlTypePDF, _
filename:=filename, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End With
End If
The problem is... I now need to save to Excel instead. I have been playing with different solutions to save the worksheet to a new workbook, but can not find one that prompts the user to save as. Also, I have a couple of buttons on the sheet that activate macros. I would like to delete/hide these in the new workbook.
Any suggestions would be greatly appreciated!