+ Reply to Thread
Results 1 to 5 of 5

Error 91

Hybrid View

sich48 Error 91 05-28-2020, 03:00 PM
Logit Re: Error 91 05-28-2020, 05:27 PM
sich48 Re: Error 91 05-28-2020, 07:41 PM
Logit Re: Error 91 05-28-2020, 09:14 PM
alansidman Re: Error 91 05-28-2020, 09:18 PM
  1. #1
    Registered User
    Join Date
    12-27-2010
    Location
    Belgium
    MS-Off Ver
    Excel 2016
    Posts
    2

    Error 91

    Hi there, When using the attached code, I get an Error 91 when closing/unloading the userform. The code runs fine and the value in the textbox is increased/decreased as intended. The error shows only after closing the form.

    Private Sub spnButton1_Change()
        Me.TextBox1.Value = Me.spnButton1.Value
    End Sub

    Private Sub UserForm_Initialize()
        Me.TextBox2.Value = 350
        Me.spnButton1.Value = Me.TextBox2.Value
        Me.Show
    End Sub
    Last edited by alansidman; 05-28-2020 at 09:18 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,446

    Re: Error 91

    .
    Place this line in a Sub all it's own : Me.Show

    Except, change the ME to the actual UserForm name.

  3. #3
    Registered User
    Join Date
    12-27-2010
    Location
    Belgium
    MS-Off Ver
    Excel 2016
    Posts
    2

    Re: Error 91

    Thank you, Logit. It's solved. I knew it would be an easy one but I couldn't figure it out.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,446

    Re: Error 91

    .
    You are welcome.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,755

    Re: Error 91

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 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
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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