+ Reply to Thread
Results 1 to 15 of 15

Method 'Run' of object '_Application' failed

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Snowmass, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Method 'Run' of object '_Application' failed

    Hi All,

    I have the following code, which is giving me the error: "Method 'Run' of object '_Application' failed" on this line:

    Please Login or Register  to view this content.
    I am trying to call a function from another spreadsheet after populating it with some data.

    Does anyone have any thoughts on why I might be getting the error message?

    Thanks!!

    Please Login or Register  to view this content.
    Last edited by brl8; 08-29-2010 at 06:25 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Method 'Run' of object '_Application' failed

    I think you're going to have to open the other workbook before running the macro.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-14-2010
    Location
    Snowmass, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Method 'Run' of object '_Application' failed

    Sorry, it's confusing but I am opening the workbook first! The ResultsFile variable holds the value Model Manager Extract Companion.xlsm.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Method 'Run' of object '_Application' failed

    So you shouldn't include the path; you're referring to the opened workbook, not the workbook on disk.

  5. #5
    Registered User
    Join Date
    07-14-2010
    Location
    Snowmass, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Method 'Run' of object '_Application' failed

    Thanks for your help. I've updated the code as follows, and now, on that same line I'm gettting this error:

    "Run-time error '1004':

    Cannot run the macro 'Model Manager Extract Companion.xlsm!CallD2ResultsFunction'. The macro may not be available in this workbook or all macros may be disabled."

    Please Login or Register  to view this content.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Method 'Run' of object '_Application' failed

    Are you sure the macro name is correct? What is the declaration line of the macro/function and where is it located? (i.e. in which module?)
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    07-14-2010
    Location
    Snowmass, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Method 'Run' of object '_Application' failed

    Thanks for your response.

    The sub I am attempting to run in the other workbook looks like this:

    Sub CallD2ResultsFunction

    .......

    End Sub

    This is located in module 1 of the Model Manager Extract Companion spreadsheet.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Method 'Run' of object '_Application' failed

    There should be an apostrophe before the exclamation mark in your macro name.

  9. #9
    Registered User
    Join Date
    07-14-2010
    Location
    Snowmass, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Method 'Run' of object '_Application' failed

    That was it!! Thank you so much.

    The working line of code looks like this:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Method 'Run' of object '_Application' failed

    Glad to help. Please don't forget to mark the question 'Solved'.

  11. #11
    Registered User
    Join Date
    04-17-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    3

    Re: Method 'Run' of object '_Application' failed

    Question: i am getting Error: Method 'Run' of object '_Application' failed.

    Please Login or Register  to view this content.

    i would like to know the why i am getting error? anything wrong with code please let me know.
    Last edited by jeffreybrown; 11-16-2019 at 08:39 PM. Reason: Please use code tags!

  12. #12
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Method 'Run' of object '_Application' failed

    You need to open the workbook before you try to run the macro.

  13. #13
    Registered User
    Join Date
    04-17-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    3

    Re: Method 'Run' of object '_Application' failed

    Thank you for your input. Please help me what code can be added into code sniplet provided so that I can get rid of the error? How to open workbook and run the macro as i am a beginner.

  14. #14
    Registered User
    Join Date
    04-17-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    3

    Re: Method 'Run' of object '_Application' failed

    And this code is working correctly in OFFICE 10 32BIT , but i am getting this error in office 10 64BIT

  15. #15
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Method 'Run' of object '_Application' failed

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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