Results 1 to 2 of 2

Thread: Fix this code for 64 bit

  1. #1
    Neophyte GIVEMETHECODE's Avatar
    Join Date
    Sep 2014
    Posts
    2
    Articles
    0
    Excel Version
    2016, 2019, Office 365 Plus

    Unhappy Fix this code for 64 bit



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello All,

    How can I fix this code for 64 bit?

    Code:
    Private Declare Function ShellExecute Lib "shell324dll" _
    Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    
    
    Sub SendEMail()
        Dim Email As String, Subj As String
        Dim Msg As String, URL As String
        Email = Cells(ActiveCell.Row, 10)
            
        Subj = Cells(ActiveCell.Row, 4)
    
    
        Msg = ""
        Msg = Msg & "Dear " & Cells(ActiveCell.Row, 1) & "," & vbCrLf & vbCrLf & "Here is some precanned text before the BODY info in the spreadsheet. " & vbCrLf & vbCrLf & Cells(ActiveCell.Row, 13) & vbCrLf & vbCrLf & " And here is some more precanned text in the macro AFTER the Body stuff."
        
        'Replace spaces with %20 (hex)
        Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
        Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
        
        'Replace carriage returns with %0D%0A (hex)
        Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
        
        'Create the URL
        URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
        
        'Execute the URL (start the email client)
        ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
        
        'Wait two seconds before sending keystrokes
        'Application.Wait (Now + TimeValue("0:00:02"))
        'Application.SendKeys "%s"
    End Sub
    Any and all help is always greatly appreciated!

  2. #2
    Conjurer snb's Avatar
    Join Date
    May 2013
    Posts
    375
    Articles
    0
    Excel Version
    2020
    Why did you choose this alias ?

    Crossposted:

    http://www.mrexcel.com/forum/excel-q...ml#post3945779

Posting Permissions

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