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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,700
Messages
5,833,213
Members
430,197
Latest member
edeibold

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top