We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

Running Excel macro in an XLS file to export to PDF says "The object invoked has disconnected from its clients" on one computer

18 Views
Last Modified: 2021-04-28
We have an XLS file (not xlsm) saved in a network location with a button connected to a macro that exports the contents of a worksheet to a PDF file. It works on PC1 for user1 but it shows the error in the summary on PC2 for user2. When user1 logs into PC2, the export works. User2 has modify permission to the target network location and can create new folders and files. User2 can also manually export to PDF. Both PC's are Windows 10 Professional and have the same version of Office.

Below is the snippet from the macro code and debug highlights the "ActiveSheet.ExportAsFixedFormat" line when it fails.

  ActiveWorkbook.Save
    Sheets("Summary").Select
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "T:\folder\path\export.pdf" _
    , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    :=False, OpenAfterPublish:=True
    Sheets("Summary").Select

On PC2, Microsoft Edge was the default application for PDF files so I changed it to AdobeReader but it did not address the issue.
What could be causing this? Any idea would be greatly appreciated.
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE