+ Reply to Thread
Results 1 to 3 of 3

Excel VBA 2003 - Object disconnecting from its client.

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Washington DC
    MS-Off Ver
    For MS 365
    Posts
    54

    Excel VBA 2003 - Object disconnecting from its client.

    The code below is intended to, via Excel, convert a Word document to a PDF making use of the PDF Maker addin which is installed on the machine. This macro is only called if the machine is running Excel 2003. Newer versions make use of the ExportAsFixedFormat method, and that code is not shown here.

    The code runs well except when it gets to the ".Close savechanges:=false" line. The PDF actually gets created, but at that point I get an error that reads "object invoked has disconnected from its client". Not sure why this would happen since it is still within the wdocDocument "with" statement. After the code fails the Word document is left open, of course.

    What I've read suggests that it may be a binding problem, but I can't figure out how to fix it.

    Any help will be appreciated. Thanks.


    Please Login or Register  to view this content.

  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: Excel VBA 2003 - Object disconnecting from its client.

    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
    Registered User
    Join Date
    10-25-2012
    Location
    Washington DC
    MS-Off Ver
    For MS 365
    Posts
    54

    Re: Excel VBA 2003 - Object disconnecting from its client.

    My post got lots of "views", but you are the first to reply. I did manage to solve it myself. The solution may not be an elegant one, but it works. What I did was delete the ".Close..." statement since it seemed to be the offending line of code, and it was somewhat redundant anyway. It occurred to me that I didn't really need to close the Word document since I was quitting the Word application anyway a couple of lines later. That being the case, I altered my Quit statement to what you see below.

    The problem I've created with this solution is that the user will lose any other unsaved Word document they may have open at the time. So, I am still working on a more comprehensive and thoughtful solution, but this one gets me down the road for now.

    Thanks.


    Please Login or Register  to view this content.

+ 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