Results 1 to 7 of 7

Fixing runtime error '53'

Threaded View

  1. #1
    Registered User
    Join Date
    04-26-2016
    Location
    singapore
    MS-Off Ver
    Office xp
    Posts
    20

    Fixing runtime error '53'

    Sub CreateMailByThunderbird(Addrs As String, body As String)
    Dim sPath
    With CreateObject("ScriptControl")
    .Language = "JScript"
    
    End With
    If Application.OperatingSystem = "Windows (32-bit) NT 6.01" Then
    
            sPath = """ C:\Program Files(x86)\Mozilla Thunderbird\Thunderbird.exe"" -compose "
                  
    Else
                
            sPath = """C:\Program Files\Mozilla Thunderbird\Thunderbird.exe"" -compose "
                   
        End If
    
    arg = "mailto:" & Addrs & "?" & "body=" & body
    Shell sPath & arg
    Sleep 1000
    CreateObject("Wscript.Shell").SendKeys "^{enter}", True
    End Sub
    So I tried switching the sPath around but it will still have runtime error and made sure the path is correct. The line in red is highlighted when I debug.

    Edit

    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Sub Thunderbird_mail()
    Dim Addrs As String, body As String, data(4) As String
    
    
    Toadrs = ThisWorkbook.ActiveSheet.Cells(4, 2) 'Cells(Row number,column number)
    'kenmei = ThisWorkbook.ActiveSheet.Cells(14, 3) 'Subject
    'Name = ThisWorkbook.ActiveSheet.Cells(21, 3)  'Name
    'Purpose = ThisWorkbook.ActiveSheet.Cells(21, 8)  'Purpose
    'BookDate = ThisWorkbook.ActiveSheet.Cells(21, 20)  'BookDate
    'TimeStart = ThisWorkbook.ActiveSheet.Cells(21, 21)  'TimeStart
    'TimeEnd = ThisWorkbook.ActiveSheet.Cells(21, 23)  'TimeEnd
    Title_Name = "Name: "
    Title_Purpose = "Purpose: "
    Title_BookDate = "Book Date: "
    Title_TimeStart = "Time Start: "
    Title_TimeEnd = "Time End: "
    
    selector = Cells(21, 3).Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    Loop
    ActiveCell.Offset(-1, 0).Select
    data(0) = ActiveCell
    
    
    body = Title_Name & Name & "%0a" & Title_Purpose & Purpose & "%0a" & Title_BookDate & BookDate & "%0a" & Title_TimeStart & TimeStart & "%0a" & Title_TimeEnd & TimeEnd
    Call CreateMailByThunderbird(Addrs, body)
    End Sub
    Sub CreateMailByThunderbird(Addrs As String, body As String)
    Dim sPath
    With CreateObject("ScriptControl")
    .Language = "JScript"
    
    End With
    If Application.OperatingSystem = "Windows (32-bit) NT 6.01" Then
    
            sPath = """ C:\Program Files(x86)\Mozilla Thunderbird\Thunderbird.exe"" -compose "
                  
    Else
                
            sPath = """C:\Program Files\Mozilla Thunderbird\Thunderbird.exe"" -compose "
                   
        End If
    
    arg = "mailto:" & Addrs & "?" & "body=" & body
    Shell sPath & arg
    Sleep 1000
    CreateObject("Wscript.Shell").SendKeys "^{enter}", True
    End Sub
    Last edited by Bronx; 04-28-2016 at 04:58 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Index range fixing error
    By silambarasan.J in forum Excel General
    Replies: 4
    Last Post: 01-27-2016, 06:44 AM
  2. Trouble fixing my error message box on vba
    By Rick23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2014, 12:46 AM
  3. Fixing Date Error -
    By JCL622 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2013, 10:54 AM
  4. [SOLVED] Help me in fixing the error
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-26-2012, 07:26 AM
  5. [SOLVED] Fixing a sorting error for empty rows (error '1004')?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:20 PM
  6. [SOLVED] Fixing a sorting error for empty rows (error '1004')?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM
  7. Fixing the #DIV/0! Error
    By kc2equ in forum Excel General
    Replies: 1
    Last Post: 02-22-2005, 11:32 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