Saving a copy as PDF by saving the XLS file

Greg_dd

New Member
Joined
Jun 19, 2013
Messages
1
Every time I hit save in my excel (.XLS) document, I would like it to save a copy as .PDF.

I would like to be able to specify what directory the PDF is saved in (ideally it would be different from the directory that the .XLS file is in).
The PDF file name should be the same every time and overwrite the existing one each time.

I am using Excel 2010 and I do know how to implement VB in excel. Thank you for your time.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
small world i am looking for code to do the exact same thing. have not had much luck i am working with this.

sFileName = "http://sharepoint/electrical/Over Time Spreadsheet/OTLog.pdf"

' Save the File as PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sFileName, Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True

i plan to use this with Workbook_BeforeClose
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,696
Messages
6,126,267
Members
449,308
Latest member
VerifiedBleachersAttendee

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
Back
Top