+ Reply to Thread
Results 1 to 8 of 8

Error - "Cannot run the macro"

  1. #1
    Registered User
    Join Date
    10-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    27

    Error - "Cannot run the macro"

    Hello,

    I've created a macro to run regression analysis under the data analysis option. The first time I enter my keyboard shortcut (CTRL+SHIFT+R), the macro works fine. When I try re-entering the shortcut, I get the following error:

    "cannot run the macro the macro ". The macro may not be available in this workbook or all macros may be disabled"

    Here is my code:

    Please Login or Register  to view this content.
    When I choose to debug the error, "application.run" to the last "false" is highlighted in yellow so this is where I assume the error is. I'm just not sure why the macro would run fine the first attempt, then fail after that.

    Any help or advice would be appreciated!

    Thanks

    Regression Test.xlsm

  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: Error - "Cannot run the macro"

    Excel Options > Add-Ins > Go > tick Analysis Toolpak - VBA
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Error - "Cannot run the macro"

    Quote Originally Posted by shg View Post
    Excel Options > Add-Ins > Go > tick Analysis Toolpak - VBA
    Thanks, but that option is already ticked. As I mentioned, the macro works the first time, but then the error comes up the second, third, etc. time.

  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: Error - "Cannot run the macro"

    Works fine for me in Excel 2010, and I don't have Excel 2007 installed to test, sorry.

    What particular part of the result do you need? You could just use LINEST to get most of them.
    Last edited by shg; 01-03-2015 at 03:32 PM.

  5. #5
    Registered User
    Join Date
    10-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Error - "Cannot run the macro"

    Quote Originally Posted by shg View Post
    Works fine for me in Excel 2010, and I don't have Excel 2007 installed to test, sorry.

    What particular part of the result do you need? You could just use LINEST to get most of them.
    I'm just looking for y intercept and slope basically. Never used LINEST before, will this get me the result I'm looking for?

  6. #6
    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: Error - "Cannot run the macro"

    Select two adjacent cells, paste

    =LINEST(I2:I33, A2:A33)

    in the formula bar, press and hold the Ctrl and Shift keys, then press Enter.

    Please don't quote whole posts.
    Last edited by shg; 01-03-2015 at 04:30 PM.

  7. #7
    Registered User
    Join Date
    10-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Error - "Cannot run the macro"

    Perfect, this worked much better!

    Thank you!

  8. #8
    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: Error - "Cannot run the macro"

    You're welcome.

+ 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. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. = EMBED("Forms.ComboBox.1","") error "Reference not valid."
    By CatharinaCatharina in forum Excel General
    Replies: 2
    Last Post: 12-11-2014, 09:58 AM
  3. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  4. Macro Error with code "Range("A65536").End(xlUp).EntireRow.Insert"
    By lukasj13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2010, 08:48 PM
  5. "Clean Me" Macro is giving "#VALUE!" error in the Notes field.
    By Ryan Watkins in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2005, 08:05 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