+ Reply to Thread
Results 1 to 13 of 13

How To Auto Open Outlook from Excel

Hybrid View

Launchnet How To Auto Open Outlook from... 01-17-2011, 12:05 AM
snb Re: How To Auto Open Outlook... 01-17-2011, 05:03 AM
Launchnet Re: How To Auto Open Outlook... 01-17-2011, 01:06 PM
snb Re: How To Auto Open Outlook... 01-17-2011, 01:52 PM
Launchnet Re: How To Auto Open Outlook... 01-17-2011, 02:27 PM
  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    How To Auto Open Outlook from Excel

    I currently use the following code to open any of my 4 types of email accounts, such as hotmail, gmail, juno etc. Now I am adding Outlook and I don't know how to incorporate it into my code.

    As an Ex: I have a seperate worksheet that I place the name hotmail.com and the following code will open it. I use a separte cell for each email address along with a separate macro for each email name.

    I doubt that I can use this same code. I think that I have to use Outlook.exe ?????

    Help would be appreciated.

    Sub OpenMyeMailNo2()
    Dim oShell
    Dim sUrl As String
     sUrl = "http://" & Sheets("Setup").Cells(9, 5).Value
        Set oShell = CreateObject("Wscript.Shell")
    
        oShell.Run (sUrl)
    End Sub
    Last edited by Launchnet; 01-20-2011 at 01:06 PM.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How To Auto Open Outlook from Excel

    Sub snb()
      with createobject("Outlook.Application")
    
      End with
    End Sub
    Your code can be reduced to:

    Sub OpenMyeMailNo2()
      Shell "http://" & Sheets("Setup").Cells(9, 5).Value
    End Sub
    Last edited by snb; 01-17-2011 at 01:52 PM.



  3. #3
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How To Auto Open Outlook from Excel

    Good Morning from California

    Thanks SNB for your input

    When I copied your snb code, the following line turned red.

    [CODE]with createobject("Outlook.Application[/CODE]

    I also just thought of the fact that I want to open Microsoft Office Outlook.


    2nd . . .
    In your following code . . .

    Sub OpenMyeMailNo2()
      Shell "http://" & Sheets("Setup").Cells(9, 5).Value
    End Sub
    the value in cells (9,5) is: hotmail.com

    when I run this macro I get an error message "Run-time error '53':
    File not found.

    Got any additional suggestions? Need help.

    Thanks
    Matt

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How To Auto Open Outlook from Excel

    I corrected my previous post.

  5. #5
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How To Auto Open Outlook from Excel

    Sorry snb

    I can not see any posting of a change and the original posting is still the same.

  6. #6
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How To Auto Open Outlook from Excel

    I need some Ideas please.

    Thanks Matt

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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