title: VBA - Alternatives to Using Shell32.dll
body: <p>I'm trying to write a VBA script that will take an email address, then open it in a new window. The trick is I'll need to get it to run without using Shell32.dll.</p>
  
  <p>Based on the code, below, is there any other way to rewrite the following?</p>
  
  <pre><code>Option Explicit
  
  Private Declare Function ShellExecute _
    Lib "shell32.dll" Alias "ShellExecuteA" ( _
    ByVal hWnd As Long, _
    ByVal Operation As String, _
    ByVal Filename As String, _
    Optional ByVal Parameters As String, _
    Optional ByVal Directory As String, _
    Optional ByVal WindowStyle As Long = vbMinimizedFocus _
    ) As Long
  
  Public Sub OpenUrl()
  
  Dim olItem As Outlook.MailItem
  Set olItem = Application.ActiveExplorer().Selection(1)
  Dim sTemp As String
  Dim sURL As String
  
  If olItem.SenderEmailType = "EX" Then
      sTemp = olItem.Sender.GetExchangeUser().PrimarySmtpAddress
  Else
      sTemp = olItem.SenderEmailAddress
  End If
  
  sURL = "https://afakeurl.com/" + sTemp
  
  Dim lSuccess As Long
  
  
  lSuccess = ShellExecute(0, "Open", sURL)
  
  End Sub
  </code></pre>