+ Reply to Thread
Results 1 to 5 of 5

Runtime error '91' when trying to open userform in Excel

  1. #1
    Registered User
    Join Date
    05-30-2011
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    9

    Runtime error '91' when trying to open userform in Excel

    Hi,
    I've created a bespoke userform in Excel 2016 for my sales manager and everything was going great until I started getting an error loading the form.
    I have an active x command button that very simply opens the form with the code frmOrders.Show but I keep getting runtime error '91' every time I run it.
    I can't understand it as it was working fine and then it just simply wasn't! It makes no sense as the code is right. I just don't get it... Has anyone else had the same problem? Can it be solved and how?
    Thanks in advance,
    G

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Runtime error '91' when trying to open userform in Excel

    The problem is more than likely with code in the userform initialize or activate event rather than anything to do with that command button.

    Would it be possible for you to attach the file so we can investigate the issue?

    Beth.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,132

    Re: Runtime error '91' when trying to open userform in Excel

    In the VB Editor, select Tools > Options > General > check Break in Class Module > Ok.
    Then click your activeX button to open the form. You should then be able to find where the code is failing.

  4. #4
    Registered User
    Join Date
    05-30-2011
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Runtime error '91' when trying to open userform in Excel

    Thanks Fluff13 - that showed where the code was not working so now to solve where that line of code is going wrong!

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,132

    Re: Runtime error '91' when trying to open userform in Excel

    If you care to post your code & explain what line is failing & what the error number & message are, I'm sure we could help.
    A copy of the workbook would also help

+ 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] Runtime 440 error when opening a UserForm
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-13-2022, 02:52 AM
  2. VBA Userform Runtime Error 35788
    By elind21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2018, 08:20 PM
  3. [SOLVED] vba excel - Parental control multipage userform runtime error 438
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-11-2017, 02:45 PM
  4. Runtime Error VBA Userform
    By houthoofdmichael in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-11-2017, 09:25 PM
  5. [SOLVED] Getting a runtime error if I have two workbooks open
    By Nitro2481 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2016, 09:54 AM
  6. [SOLVED] Runtime error '13' type mismatch when posting userform entries to excel table
    By Deventre in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2016, 11:32 AM
  7. [SOLVED] Runtime error on UserForm
    By DJvdW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2013, 10:16 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