Macro to save excel file as pdf and xlsm

cal024

New Member
Joined
Jul 28, 2010
Messages
1
Hi,
I have a macro that saves an excel sheet as a pdf and names the pdf based on cell contents as below.

Sub SPO()
'
' SPO Macro
'
Dim OrdName As String
Dim OrdNumb As Integer
OrdName = Sheets("PO FORM").Range("B8").Text
OrdNumb = Sheets("PO FORM").Range("H2").Text
SaveFileAs.Filename = "H:\Production\ORDERS\" & OrdName & "G0" & OrdNumb & ".pdf"
SendKeys Filename & "{ENTER}", False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"CutePDF Writer on CPW2:", Collate:=True
End Sub

I would like then to save active worksheet as the original excel sheet in the original folder. I have been unsuccessful as I can only get it to save in original folder as pdf not excel.
Any ideas would be greatly appreciated

Regards
Chris
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Watch MrExcel Video

Forum statistics

Threads
1,108,581
Messages
5,523,710
Members
409,532
Latest member
Lmfacc

This Week's Hot Topics

Top