Excel to email PDF page of spreadsheet

sassriverrat

Well-known Member
Joined
Oct 4, 2018
Messages
655
I have excel and I have outlook (on the physical computer). I have a button that I made that saves/archives/quits the workbook. Is it possible to have excel make a pdf of the active page and have it email out via outlook to a series of specified emails (emails to be specified on another page in a series of specific cells (each cell is a different email- let's say A1:A3 for the sake of the argument.

Thanks!
 
Brilliant! They both work. @John_w I realized the error was on my side but your msgbox was a brilliant idea- so I have a print macro that establishes the print area in the print macro, not in the macro that created the sheet and there lay my problem. Sooooo here's what I've done-

Question for both of you- not trying to start a fight but pure curiosity as my intuition would say yes, but is John's piece of code any more efficient (because it's shorter and doesn't create and delete the extra folder) than Logit's?

I put the macro into a new module and named it 'EmailReport

I then went into the bottom of my print module and the last line became the following code. My last question lies here- the code below is so that if (on another page), the text box says to, then the report will be emailed. If the cell (text box) does not say to email, it will simply print (versus doing both). As such, the print button on the activesheet will run through the print macro, print the page, and decide at the end if it should call the emailreport macro. Is there a way for excel to confirm the email is either in the outbox or has been sent?
Thanks
Code:
If Sheets("Notes").Range("F16").Value = "Daily Report Emailed" Then        Call Email_Active_Sheet
    Else:
    End If
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
The speed difference should be negligable.

A procedure, using Outlook VBA, should be possible which searches the Sent Items and Outbox folders for the same email subject as specified in the EmailReport macro and sent within a specific time range.
 
Upvote 0
Can I bother you for one more piece of code? I guess it might search for the date as well (because this email is going to be sent daily with a new pdf (report) daily)?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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