Results 1 to 2 of 2

Thread: Run Time Error 438

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Jul 2018
    Posts
    1
    Location

    Run Time Error 438

    hi guys,
    could you please help me to solve the error( the error comes from Bolded line)

    Sub SendReminderMail()
    Dim OutLookApp As Object
    Dim OutLookMailItem As Object
    Dim iCounter As Integer
    Dim MailDest As String
    Dim Mailsubject As String
    
    
    
    
     
    Set OutLookApp = CreateObject("Outlook.application")
    Set OutLookMailItem = OutLookApp.CreateItem(0)
    
    
    With OutLookMailItem
    MailDest = ""
    
    
    For iCounter = 1 To WorksheetFunction.CountA(Columns(5))
    If MailDest = "" And Cells(iCounter, 5).Offset(0, -1) = "Send Reminder" Then
    MailDest = Cells(iCounter, 5).Value
    ElseIf MailDest <> "" And Cells(iCounter, 5).Offset(0, -1) = "Send Reminder" Then
    MailDest = MailDest & ";" & Cells(iCounter, 5).Value
    End If
    Next iCounter
    
    
    Mailsubject = ""
    For iCounter = 1 To WorksheetFunction.CountA(Columns(1))
    If Mailsubject = "" And Cells(iCounter, 1).offest(0, -1) = "Send Reminder" Then
    Mailsubject = Cells(iCounter, 1).Value
    ElseIf Mailsubject <> "" And Cells(iCounter, 1).Offset(0, -1) = "Send Reminder" Then
    Mailsubject = Mailsubject & ";" & Cells(iCounter, 1).Value
    
    
    End If
    Next iCounter
    
    
    
    
    
    
     
    .To = MailDest
    .subject = Mailsubject
    .Body = "Reminder: ."
    .Send
    End With
    
    
    Set OutLookMailItem = Nothing
    Set OutLookApp = Nothing
    End Sub
    Last edited by Paul_Hossler; 07-15-2018 at 07:57 AM.

Posting Permissions

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