Gassiusmax
New Member
- Joined
- May 27, 2014
- Messages
- 18
Hi Guys, I know it seems to be a hot question but I can not seem to resolve what I am aiming for.
I would like to be able to export to PDF with the file name based on a cell reference, and then email the PDF with the email addresses within a set range on the spreadsheet
is what I have so far but i can not seem to progress it to the final stage. as far as automation goes I do not need any messages until the end when email is sent or not sent
Thanks in advance for any input
Dan
I would like to be able to export to PDF with the file name based on a cell reference, and then email the PDF with the email addresses within a set range on the spreadsheet
Code:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">Private Sub CommandButton1_Click()'This macro opens the SaveAs option with the defult file path "you have to set this file path below" coverts the whole sheet into .pdf file format'And opens the .pdf to view <-- you can disable the view after covert option with lower code: OpenAfterPublish:=False pdfName = ActiveSheet.Range("D4") ChDir "C:\DROPBOX\DATA PLAN CONFIRMATIONS" 'This is where youo set a defult file path. fileSaveName = ActiveSheet.Range("D4") ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ fileSaveName _ , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _ :=False, OpenAfterPublish:=False Set Mail_Object = CreateObject("Outlook.Application") End Sub
</code>
is what I have so far but i can not seem to progress it to the final stage. as far as automation goes I do not need any messages until the end when email is sent or not sent
Thanks in advance for any input
Dan