#1
|
|||
|
|||
Saving an Excel document to PDF - VBA
Hi,
Basically i am trying to save my excel sheet to a PDF by using a VBA. What i have tried doing is saving the document under my current sheet name (as i have multiple sheets), so i dont have to edit the PDF afterwards in terms of name. This is what ive got so far Sub PDF() Dim strXLName As String, strPDFName As String, intPos As Integer strXLName = ActiveSheet.Name intPos = InStr(1, strXLName, ".") strPDFName = Left(strXLName, intPos) & "pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=strPDFName, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=True End Sub But this does not save it as the sheet name like i want it too?, even just a certain cell it saves it as would be alright?, any ideas? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving As a 2013 document into 2007 document. | mohsen.amiri | Word | 3 | 07-02-2015 02:44 PM |
Saving excel document as PDF (centered on PDF page) | jyfuller | Excel Programming | 3 | 03-30-2015 12:24 PM |
Problem with saving document after paste some contents from another document | expert4knowledge | Word | 3 | 11-26-2013 03:53 AM |
saving data in excel 2010 from excel 2003 | johnkcalg | Excel | 1 | 02-06-2012 07:33 PM |
Update Document Template when Saving the Document File | bjbercaw | Word | 3 | 11-16-2010 02:03 PM |