+ Reply to Thread
Results 1 to 2 of 2

excel/outlook runtime error 440

  1. #1
    Registered User
    Join Date
    01-26-2015
    Location
    USA
    MS-Off Ver
    Microsoft Office 2010
    Posts
    24

    excel/outlook runtime error 440

    Good morning,

    Not sure if this belongs here or not but it has to do with outlook and ExceL. I have A script in outlook that when a trigger email is sent by me it runs a macro in an excel spreadsheet that is already open. However, I always get run time error 440 method run of object aplication failed. Any help would be apreciated below is my script in outlook. thanks!


    Sub ExcelMacro(MyMail As MailItem)

    Dim path As String
    Dim eApp As Excel.Application

    Set eApp = GetObject(, "Excel.Application")
    With eApp
    path = "M:\Sam\Ear\Automated Queries\Add-on Promo.xlsm"
    eApp.Run "'Add-on Promo.xlsm'!RunAllMacros"

    End With
    End Sub

  2. #2
    Forum Contributor
    Join Date
    06-11-2014
    MS-Off Ver
    Office 2003, 2007 & 2010
    Posts
    119

    Re: excel/outlook runtime error 440

    The only way this will work is if you either A) only have this one workbook open at all times or B) you cycle through the open workbooks and explicitly pick out the one your want.

    If you only have this workbook open, your code is correct except you won't need to define the path of your workbook (as it's being taken from an open instance). So, troubleshooting:

    Is the macro in your file in it's own module and is it a Public Sub?
    Is the filename / name of the macro in your excel file correct compared to your outlook code?
    Do you have a reference to Microsoft Excel Object Library in your Outlook vba?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. outlook runtime error 2147221233
    By dannydias in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-05-2014, 06:08 AM
  2. Replies: 3
    Last Post: 07-20-2014, 11:46 AM
  3. Excel macro to get outlook contact info (runtime error/crashing)
    By ZTHawk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2012, 04:19 AM
  4. [SOLVED] Set OutApp = CreateObject("Outlook.Application") - Runtime error 429
    By Buffyslay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-29-2012, 09:44 AM
  5. [SOLVED] Calling Outlook in Excel runtime error
    By Nicole Seibert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2006, 04:15 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