+ Reply to Thread
Results 1 to 7 of 7

Need Help: VBA Run Time Error 91

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    Moline, IL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Question Need Help: VBA Run Time Error 91

    Hello, I am developing a spreadsheet that will take the values obtained from a macro and create graphs out of them. I believe my coding is sound, but when I click on the button that should generate the graph, the error mesage: "Run Time Error 91" occurs meaning that the object variable isn't set, which I do not know what that means or how to remedy it. The code is listed below. Thank you for your help in advance.

    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Last edited by 6StringJazzer; 01-23-2014 at 03:40 PM. Reason: code tags

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need Help: VBA Run Time Error 91

    Which workbook and which module have you inserted this code in? Are you working with a particular workbook that has a sheet "Results" or could it be one of many?

    I am asking because I wonder why the code refers to ActiveWorkbook, instead of the workbook containing the code, or a particular workbook.

    Which line of code causes the error? You will see if you select "Debug" when the error pops up.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need Help: VBA Run Time Error 91

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    01-23-2014
    Location
    Moline, IL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need Help: VBA Run Time Error 91

    There are multiple workbooks, but it is referencing this one in particular. There is a sheet titled "results" where I am getting the data from. The first line of code gives the error and if I put apostrophes, to make them notes, the next two lines give errors as well. I hope I'm helping you help me. I will try that code first thing tomorrow xladept, thank both of you for your responses.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need Help: VBA Run Time Error 91

    There is no active AutoFilter in sheet Results. Adding the following line as the first line of code may resolve it.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-23-2014
    Location
    Moline, IL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need Help: VBA Run Time Error 91

    Quote Originally Posted by 6StringJazzer View Post
    There is no active AutoFilter in sheet Results. Adding the following line as the first line of code may resolve it.

    Please Login or Register  to view this content.
    I have inserted this line of code and it seems to have remedied the previous problem, thank you very much. However, a problem occurs in the .Apply line : Runtime Error 1004: which says that you can not move a pivot table report. I will put the code below:

    Please Login or Register  to view this content.
    I have also used the code provided by xladept and the same error presented in this post occurred on the same line. Thanks again guys!
    Last edited by brandonlbrewer; 01-24-2014 at 08:59 AM. Reason: Add more information

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need Help: VBA Run Time Error 91

    Hi Brandon,

    You're welcome and thanks for the rep!

    BTW - is it a Pivot Table Report?

+ 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. Cannot Publish Excel Pivot Chart - Run Time Error
    By crisb184 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2013, 07:04 AM
  2. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  3. Replies: 7
    Last Post: 05-15-2013, 09:02 AM
  4. run-time error ;2147023179 (800706b5) time automation error interface unknown
    By karthik72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2012, 09:31 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM

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