+ Reply to Thread
Results 1 to 5 of 5

macro and userforms crash and give Run-time error '-2147417848 (80010108)'

  1. #1
    Registered User
    Join Date
    05-25-2011
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    52

    macro and userforms crash and give Run-time error '-2147417848 (80010108)'

    Ok, so I have this custom macro I created. When a button is clicked it opens a userform, then opens a second userform, then runs the macro. It used to work, not 100% sure when it stopped, but here's what happens. I click the button, get to userform1, get to userform2, then the code runs, and right at the end of the code I get this error:
    Run-time error '-2147417848 (80010108)':
    automation error
    the object invoked has disconnected from its clients

    But the weird thing is when I click debug it highlights the userform2.show line of code. If I then try to open the userform, excel crashes. I don't know why that would cause the error if it seems to run through it seamlessly. Anybody seen this before or know how to fix it?

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: macro and userforms crash and give Run-time error '-2147417848 (80010108)'

    You will have to F8 through the code to find the actual line that causes the error. Be sure to post the code involved when you report back. (And use code tags. It's the hash # icon on the message bar.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    05-25-2011
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: macro and userforms crash and give Run-time error '-2147417848 (80010108)'

    ok this is where the error is:
    Please Login or Register  to view this content.
    when I step into it what happens is it runs the above code, then runs my other macro, then upon completing the macro it goes back to that line of code to give the error. I do not call the form again, it just fails, even though it had to go through there to get to the next code which it does fine. I found a workaround that I put in an "end" before the end sub, so that fixes it, but it still doesn't make sense

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro and userforms crash and give Run-time error '-2147417848 (80010108)'

    Looking at that code I suspect you are getting stuck in a loop. Which form is that code in?

    The sequence of events should be that form1 loads form2 without trying to unload itself (that won't happen until form 2 is unloaded anyway unless the forms are modeless) and then when form2 unloads it does not try to reload form 1 since form1 is already loaded and control will pass back to it automatically.
    Remember what the dormouse said
    Feed your head

  5. #5
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: macro and userforms crash and give Run-time error '-2147417848 (80010108)'

    You can Hide the UpdateForm then cal the other form, then unload the UpdateForm form.

+ 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