+ Reply to Thread
Results 1 to 3 of 3

Userform throws runtime error 91

  1. #1
    Registered User
    Join Date
    09-20-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    1

    Userform throws runtime error 91

    I have a file that was uses a common Userform for list selections. If I open the file by going to the folder where it resides and double-click on the file name to open the file, the Userform code throws runtime error 91 when it reaches a line of code involving the ListBox on the form. The debugger shows the ListBox as 'Nothing' when I put it in the watch window. However, if I open the exact same file from the Excel recent history, it works as intended.

    The errors only occur on a computer running Office 365. If I run the exact same code on a computer running Excel 2013, it runs as intended regardless of how I open the file.

    What is going on and how do I get the correct behavior by double-clicking the file name?

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

    Re: Userform throws runtime error 91

    Welcome to the Forum CaptDunsel!

    The problem you are describing is not common enough that we know the answer without being able to see your file. It's not common at all. In fact it may be unique.

    Error 91 means you are referencing an object that has not been set; you have confirmed that by showing it's Nothing. That shouldn't happen with a control on a UserForm, unless you are doing things like dynamically creating or deleting controls.

    I would suggest that you attach your Excel file here. Remove any private data, and explain how we run your code and steps to get to where the error occurs.

    If you don't attach the file, at a bare minimum we need to see all of the code in your entire file.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,257

    Re: Userform throws runtime error 91

    Quote Originally Posted by CaptDunsel View Post
    ... errors only occur on a computer running Office 365. If I run the exact same code on a computer running Excel 2013, it runs as intended ...
    As above 6StringJazzer ... and ... How is UserForm initialized in code ?

+ 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. VBA Userform Runtime Error 35788
    By elind21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2018, 08:20 PM
  2. Runtime Error VBA Userform
    By houthoofdmichael in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-11-2017, 09:25 PM
  3. [SOLVED] Runtime error on UserForm
    By DJvdW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2013, 10:16 AM
  4. 2007 VBA Code in 2010 Throws Multiple Errors: Runtime Error 91 and more
    By VB@N3wb|3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2013, 09:54 AM
  5. Excel Checkout throws runtime error 2147417851 (80010105)
    By Tester408 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-03-2013, 06:25 AM
  6. RunTime error with UserForm!.Show
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-03-2011, 09:42 AM
  7. [SOLVED] Excel 2000 -> Excel 2003 now throws 'runtime error'
    By Ralph L in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2006, 12:25 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