+ Reply to Thread
Results 1 to 2 of 2

Runtime Error 438

  1. #1
    Registered User
    Join Date
    02-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    1

    Runtime Error 438

    Please help me with this issue, im new in Macro. I got this codes https://www.youtube.com/watch?v=sIQLedQPrPs






    Sub SendEmail(what_address As String, subject_line As String, mail_body As String)
    '
    ' SendEmail Macro
    '

    '
    Dim olApp As Outlook.Application
    Set olApp = CreateObject("Outlook.Application")

    Dim olMail As Outlook.MailItem
    Set olMail = olApp.CreateItem(olMailItem)

    olMail.To = what_address
    olMail.Subjeect = subject_line
    olMail.Body = mail_body
    olMail.Send



    End Sub
    Sub SendMassEmail()

    row_number = 1

    Do
    DoEvents
    row_number = row_number + 1
    Dim mail_body_message As String
    Dim ip_address As String

    mail_body_message = Sheet1.Range("J2")
    ip_address = Sheet1.Range("D" & row_number)
    mail_body_message = Replace(mail_body_message, "ip_address", ip_address)
    MsgBox mail_body_message

    Call SendEmail(Sheet1.Range("A" & row_number), "This is a test e-mail", Sheet1.Range("J2"))
    Loop Until row_number = 6


    End Sub

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: Runtime Error 438

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ben Van Johnson

+ 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. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  2. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  3. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  4. runtime error 3265 error in a VBA Query to pull info from ERP Database
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-12-2010, 03:59 PM
  5. Excel xmlHTTP object error message - system/runtime error
    By Porky2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 09:36 AM

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