Email report directly from within the workbook.

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Goshute wrote:When you send a test message with the same size and number of attachments manually, how long does it take to send? If your Internet service is not fast, the message may sit in the Outbox for a while before it's completely sent.
At the present moment I am unable to send an email using Outlook. I just can’t seem to setup email in Outlook 2007. I’ve tried numerous email addresses. I am using Verizon DSL. My internet connection is very quick, but my patience is getting pretty low. :hairout: :flee: :hairout:

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email report directly from within the workbook.

Post by HansV »

Has Verizon given you an e-mail address? If so, they should have provided instructions for setting up the e-mail account.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Yes they did, but it was a while back. I don’t have a clue what it is anymore. I have to many email address already, I’m having a hard time just keeping up with what I have, lol
I only use my Verizon DSL for internet access

User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: Email report directly from within the workbook.

Post by Goshute »

In Outlook 2007 (the menu may vary a little) run Tools | Email Accounts | View or Change | Select your appropriate active email account | Change | Test Account Settings | OK through the test. Report back what problems you have.

See also http://www22.verizon.com/residentialhel ... nd+use.htm" onclick="window.open(this.href);return false; and http://www22.verizon.com/ResidentialHel ... 128170.htm" onclick="window.open(this.href);return false;

If Verizon is your ISP but not your email address, activate your GMAIl address, select it as primary, make sure it is in your Outlook Send-&-Receive group, and then re-run the email account test in Outlook.
Goshute
I float in liquid gardens

User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: Email report directly from within the workbook.

Post by Goshute »

HansV wrote: doesn't your ISP give you a "normal" e-mail account (I mean, not a webmail account such as Yahoo, Gmail and Hotmail)?
Hans, in the US, not necessarily. I have Qwest DSL, and a Gmail address. Qwest, Verizon, and many of the phone companies in the US try to sell a package with MSN and/or other rubbish, but if the buyer insists, they will sell net access with no other services at all.
Goshute
I float in liquid gardens

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email report directly from within the workbook.

Post by HansV »

Goshute wrote:Hans, in the US, not necessarily.
Thanks, I didn't know that. I thought you always got one or more e-mail addresses from your ISP.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

I was almost on the verge of giving up yesterday, nothing seem to work. :flee: :hairout:
But today I regrouped and then came across where Ron de Bruin suggests downloading Windows Live Mail for my Hotmail.
After that I then I made my adjustments to Outlook,
Low and behold everything started working
I played around with the code trying different things
Now I’m Happy :cheers: :bananas:

I also want to thank Hans and Goshute for your most welcome assistance :thankyou:

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Hi
I seem to be having a problem with sending an email. What happens is when I select the Send Email button that is located on the worksheet (“Email”) it opens up it lets me attach a folder if so desired, then opens my Outlook 2007 email for display, at this point everything looks great. I then select the send button and it appears that the email has been sent. But if I reopen Outlook 2007 I notice that the email is resting in the Outbox and will not send until I send from Outlook 2007. Now if I open Outlook 2007 and leave open then go through the process from my excel sheet, it sends the email right then and there. Is this normal I’m new to using Outlook.

I have attached a sample of a worksheet, may be its something in my code
Sample.xlsm
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email report directly from within the workbook.

Post by HansV »

I've seen this happen too sometimes, but not always. I don't know what causes it. The obvious workaround is to start Outlook before sending e-mails from Excel. You could even do that from your code.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Hi Hans
What type of code do you suggest I might try? I have attached a sample copy on post 24764 of what I am using so far

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email report directly from within the workbook.

Post by HansV »

You could add this line at the beginning of the code for the Send Email command button:

Shell "Outlook.exe", vbNormalFocus
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Hi Hans
Thank You
I added the line of code you suggested and it now allows me to send email A.S.A.P.
I also noticed at times that Outlook would stay opened in front of the worksheet which I would then have to select the sheet at bottom so that I could then attach file or ? to email, so I added

Code: Select all

Sheets(“Email”).Select 

Just below

Code: Select all

Shell "Outlook.exe", vbNormalFocus
And that seemed to help.

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email report directly from within the workbook.

Post by HansV »

Great!
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Hi Hans
At this point everything seems to be working great except for one small thing. I’m using this code below that will allow me to add additional lines, like a signature. But on Range D10 this cell is used for a phone number. I have that cell already formatted for phone#, so from the workbook it works great, it just when I run this code the numbers do enter in a phone# format (555) 555-5555. Any suggestions

Code: Select all

    strbody = ("Hi ") & Sheets("Email").Range("D4") & vbNewLine & vbNewLine & _
              Sheets("Email").Range("D7") & vbNewLine & _
              Sheets("Email").Range("D8") & vbNewLine & _
              Sheets("Email").Range("D9") & vbNewLine & _
              Sheets("Email").Range("D10")

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email report directly from within the workbook.

Post by HansV »

The Text property of a cell returns the value as displayed, so use

Sheets("Email").Range("D10").Text
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Email report directly from within the workbook.

Post by ABabeNChrist »

Thank you Hans