Avatar of realtimer

asked on 

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

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.

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "T:\folder\path\export.pdf" _
    , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    :=False, OpenAfterPublish:=True

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.
PDFMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment

8/22/2022 - Mon