Results 1 to 1 of 1

Thread: Printer Error while updating Data Connections

  1. #1
    Neophyte JohnMDZ's Avatar
    Join Date
    Nov 2020
    Posts
    1
    Articles
    0
    Excel Version
    Excel 2019

    Printer Error while updating Data Connections



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi,

    I created a Excel file to combine different other Excel files in one Pivot-Table, I used Power Query for that. In sense of usability I created a button which updates all connections and Pivots in the file via vba. The button work well on my machine. In contrast to my colleagues machine, when he opens the file a Message Box with this translated text occure: "An error occurred when printing to PRINTER-NAME. Microsoft Excel could not print. This may be caused by the following: ..."

    After he hits "ok". The file is working as expected. I used the following VBA-Code.

    Code:
        ThisWorkbook.Connections("Query 1").Refresh
        ' wait until query 1 is done
        Application.CalculateUntilAsyncQueriesDone
    
    
    
        ThisWorkbook.Connections("Query 2").Refresh
        ' wait until query 2 is done
        Application.CalculateUntilAsyncQueriesDone
    
    
    
        ' refresh all PivotTables
        Dim PT As PivotTable
        Dim sheet As Worksheet
        For Each sheet In ThisWorkbook.Sheets
            For Each PT In sheet.PivotTables
                PT.RefreshTable
            Next PT
        Next sheet
    "Query 1" connects to a file, which contains paths to the files of interests. "Query 2" uses these paths to access the different files and combine them to one datasets. This makes it necessary to update "Query 1" first, and afterwards update "Query 2".

    I have no idea, where this Error is coming from. The file is not designed to print anything and my colleagues didn't print that day. I would be glad, if someone could give me a hint on that.

    Thanks
    John
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot 2020-11-18 100048.png 
Views:	2 
Size:	13.6 KB 
ID:	10202  

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •