How do I use macro in Excel 2007 to convert to and email PDF file

  • Thread starter Thread starter rick5555
  • Start date Start date
R

rick5555

When I assign a macro to convert & sent PDF file it seem to work when I
record the macro but when I run it it attached an xls file instead of a pdf
file.
 
Ron de Bruin,

Everything is actually accomplished in Excel 2007 - When recording the macro
I go to the Ribon on Excel 2007 and select Send and then Email as PDF
attachment it launches my email and attaches a PDF file of the spreadsheet I
am in. However, when I actually run the macro it does everything right but
it attaches the xls file instead of the PDF.
 
I have no problem creating a PDF or email a PDF if I do it manually. The
problem is when I run a recorded macro to email a PDF it attaches an xls file
and not a PDF. I can even record a macro to create a PDF file and save to my
desktop that works just fine.
 
That works GREAT! Thanks. One more question. How do I need to change the
code if I wanted to send the entire workbook and not just the active page?
 
In the macros above the mail example you see how you can do that

Replace the ExportAsFixedFormat block in the mail macro with this


ActiveWorkbook.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FilenameStr, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
 
I think I figured. I changed "activesheet" to "activeworkbook" and that
seems to work. Thanks again you have been very helpful.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top