

Ws.ExportAsFixedFormat xlTypePDF, strFileName

Set ws = wb.Sheets("INSERT SHEET NAME HERE") 'Try to avoid using ActiveSheet, or ActiveWorkbook StrFileName = "C:\Users\Documents\ERC Files\EOSR\" & Format(Now(), "YYMMDD") & "_EndofShiftReport.pdf"

'Here's your filename with the date - date retreived via Now() function Hey mate, had a few spare moments, so messed around with your code a bit: Sub PrintToPDF_Email() Set EmailItem = Emailapp.CreateItem(olMailItem)ĮmailItem.To = "End of Shift Report DATE"ĮmailItem.HTMLBody = "Hello Team, In the attachment is the following End of Shift Report"Į "C:\Users\Documents\ERC Files\EOSR\EndofShiftReport.pdf" MsgBox "Please, open Outlook before pressing 'okay'" "C:\Users\Documents\ERC Files\EOSR\EndofShiftReport.pdf" Sub PrintToPDF_Email()ĬhDir "C:\Users\Documents\ERC Files\EOSR"ĪctiveSheet.ExportAsFixedFormat Type:=xITypePDF, Filename:= _ Now the macro works, I was just wondering is there a way where I can save the pdf file with set day and locate the file with the set date to insert as attachment, with file name and set day. if not am happy that i solved yours tooo.I recently created a macro where I can convert an excel to PDF and email the attachment to certain people. I just searched about same issue so i found yours too so am posting this now may be you already sorted out. Open converted PDF (Policy Document or any) in Adobe Acrobat DC or Any Adobe PDF Editor then right-click on the Icon or document which you hyperlinked in the root policy document then click -> create link and select invisible rectangle -> then at left bottom click open web page and click ok then it popups url space then go to your google drive where you saved all your supporting documents for this policy then right-click on the particular document you wanted to link and get shareable link copy it and paste in the URL space in pdf editor and click ok and save the document :-) now your policy with embedded documents will work in pdf mode also. Upload all the files(password protected-UN-editable) which you want to link in policy(encrypted) to your google drive and give permissions to everyone who has this link.

I too had this problem, but found the solution at lastįor proper format you may convert the embedded objects (PDF's, Word,Excels) in policy as a link but after converting it to PDF it shows as image but format remains same means name which you want.
