+ Reply to Thread
Results 1 to 6 of 6

Run TIme error 91 Object variable or with block variable not set

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    3

    Run TIme error 91 Object variable or with block variable not set

    Hi,

    Im kinda new with excel and i need help with the error im encountering. I intend to use the code as a counter with 2 conditions one for the date and the second for the case indicated. Im getting the run time error 91 object variable or with block variable not set
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 04-18-2013 at 02:53 PM. Reason: Added Code Tags

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: Run TIme error 91 Object variable or with block variable not set

    The code you posted gives no clue what Program, DateStart, DateEnd are.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Run TIme error 91 Object variable or with block variable not set

    Hi i have attached a sample copy of the form,

    Program is the name of the combobox and datestart and date end are the names of the date picker

    Thanks,
    Attached Files Attached Files

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run TIme error 91 Object variable or with block variable not set

    When I run the code from the button it works fine, it's only when I try and run it from the VBE that the error occurs.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    04-18-2013
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Run TIme error 91 Object variable or with block variable not set

    thats the issue im having, im not sure if there is something wrong with the code..

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run TIme error 91 Object variable or with block variable not set

    The problem is that you've given the Summary sheet the codename GetData, which is the same name as the button.

    Change one of them, I changed the button's name to cmdGetData.

    By the way, will you be running the code from the VBE?

    PS If you do change the button name you'll need to rename the sub accordingly, eg cmdGetData_Click.

+ 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