+ Reply to Thread
Results 1 to 4 of 4

Runtime Error -2147417848 (80010108) The Object Invoked Has Disconnected

  1. #1
    Registered User
    Join Date
    03-27-2013
    Location
    Gastonia, NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Smile Runtime Error -2147417848 (80010108) The Object Invoked Has Disconnected

    I've been a longtime lurker and am now a first time poster! I hope this isn't the case, but it looks like it may be a bug on Microsoft's side of things.

    I have a relatively simple macro that is run on the BeforeClose and BeforePrint conditions. The sub's purpose is to print a pdf to a networked location with a time stamp.

    Everything works great as long as the macro is not called in the BeforePrint event. Here is the code:

    Please Login or Register  to view this content.
    Now, this instance works fine...
    Please Login or Register  to view this content.
    But if I put the call to exportPDF in there, it throws up an error or crashes depending on if I have the error handler on.

    Edit: This code seems to "activate" even when the sub of BeforePrint shouldn't even be invoked. It crashes even when I simply try to close the file. The exact same code is invoked at the BeforeClose sub, and it causes no problems there.

    Moderator's note: Moved to other forum to get better exposure for this specific problem --6SJ

    Ok, I fixed the issue. The desired end result was a time stamped PDF in the same directory as the Excel file. I also wanted this file saved every time the worksheet was closed and/or printed. This was achieved by the Me.Save call in the BeforeClose and BeforePrint subs. I was trying to also call the exportPDF sub I previously defined in the BeforeClose and BeforePrint subs. This is where the error was invoked. The solution was to call the exportPDF sub in the AfterSave sub.


    This is my fully functional code:
    Please Login or Register  to view this content.
    Thank you to everyone that looked at this. I hope this helps someone else in the future.
    Last edited by johndoe86x; 10-29-2013 at 10:03 AM. Reason: Solved

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Runtime Error -2147417848 (80010108) The Object Invoked Has Disconnected

    Is this solved?

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Runtime Error -2147417848 (80010108) The Object Invoked Has Disconnected

    Oh ok, just saw your solution in the 1st post itself. In future, its better to post the solution as post 2 so its clear to others as well.

  4. #4
    Registered User
    Join Date
    03-27-2013
    Location
    Gastonia, NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Runtime Error -2147417848 (80010108) The Object Invoked Has Disconnected

    I apologize for the confusion. The solution is at the end of the OP. An added benefit is that if there are no changes made to the file, then the Me.Saved remains true, leaving the AfterSave sub uninvoked. Thus, no additional PDF files are created unnecessarily when exiting the file.

+ 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. System Error &H80010108 (-2147417848) object invoked disconnected client
    By xclrInTraining in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2013, 10:14 AM
  2. Replies: 7
    Last Post: 05-15-2013, 09:02 AM
  3. 2147417848 automation error the object invoked has disconnected from its clients
    By KasiaFavourite in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2011, 10:44 AM
  4. -2147417848 automation error the object invoked has disconnected from its clients
    By ajaykgarg in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-12-2011, 08:10 AM
  5. Replies: 12
    Last Post: 04-15-2010, 08:20 PM

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