+ Reply to Thread
Results 1 to 5 of 5

send specific sheet via gmail using a macro

  1. #1
    Registered User
    Join Date
    07-11-2016
    Location
    costa rica
    MS-Off Ver
    2007
    Posts
    6

    send specific sheet via gmail using a macro

    hi, i really need help here, im gonna put the example, i have an specific sheet with several colums, those colums are a database of info reviewed, so every time i save he info a new line is inserted and so on and so on. at the en of the day I need to send all the data base via gmail, but i dont know how to sent that o do that. heeelp please.. as sorry for the bad english is not my native language

  2. #2
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: send specific sheet via gmail using a macro

    Have a look at module 2 of the linked workbook in the link below to

    Ron de Bruin's site

    About a 1/3 of the way down the page
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  3. #3
    Registered User
    Join Date
    07-11-2016
    Location
    costa rica
    MS-Off Ver
    2007
    Posts
    6

    Re: send specific sheet via gmail using a macro

    ok was able to send an an email with a textbody, but, is there any way to attached one sheet of the info to the email?. i mean instead of the body, just the into inside the sheet( the sheet is a data base). Aaaaand thanks for you help

  4. #4
    Registered User
    Join Date
    07-11-2016
    Location
    costa rica
    MS-Off Ver
    2007
    Posts
    6

    Re: send specific sheet via gmail using a macro

    Sub send_email_via_gmail()
    Dim myMail As CDO.Message
    Set myMail = New CDO.Message

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"

    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pwd"

    myMail.Configuration.Fields.Update

    With myMail
    .Subject = TEST
    .From = "[email protected]"
    .To = "[email protected]"
    .CC = ""
    .BCC = ""
    .TextBody = "text"



    End With
    On Error Resume Next
    myMail.Send
    'MsgBox ("Mail has been sent")
    Set myMail = Nothing
    End Sub
    this is what i got in the email part, is there any way to attached the info inside the sheet?

  5. #5
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: send specific sheet via gmail using a macro

    See the link to a previous thread (I haven't got Gmail with me to test any code) for an example of how to attach a sheet (although the code could do with losing the Select's) and read post #11 as well.

    Old thread

    ...and when posting code please use code tags as per the forum rules.

    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button). The result will appear like this in the post window:

    Please Login or Register  to view this content.
    ... and appear like this when posted:



    copy to clipboard
    your code here ...
    and here ...
    and here
    You can also type the code tags in manually if you prefer. For more information about these and other tags, click here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Send excel file as attachment using gmail in macro?
    By fourmurphys in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-20-2019, 09:21 PM
  2. [SOLVED] Macro to send email via gmail program
    By excelnoob_15 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2016, 06:52 PM
  3. Send an ALERT email to a GMAIL address if conditions are met in a specific cell
    By zeegerman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2015, 04:56 PM
  4. Trying to build macro to send a gmail with a single worksheet as an html body
    By collinreuther in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2015, 05:51 PM
  5. Send Workbook with Gmail not Outlook?
    By excelji in forum Excel General
    Replies: 1
    Last Post: 07-28-2014, 10:18 PM
  6. Macro to open mailto hyperlink in excel, then click on "Send" in gmail
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2012, 11:10 AM
  7. macro to send excel sheet to specific email address
    By JonnieP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2005, 06:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1