'Linked Picture Doesn't Update Before Printing as PDF in VBA From Excel Workbook
Context: I have an Excel report where I automated all the steps with VBA. Once all my VBA code to pull in and update the data in the report has run, I export the sheet named "Weekly Report" to PDF and attach it to an outlook email.
Issue: From a table on a worksheet named "Weekly Tables", I copied a table and pasted it onto the "Weekly Report" Worksheet as a 'linked picture' using paste-special. I expected this linked picture to update and reflect the values in the table after the data is updated, but on the PDF it doesn't reflect any changes made in the referenced table.
What I've tried: The only way I have found the table to be able to update is if I manually go and navigate my screen to be viewing the linked picture, where it updates after a few moments.
Question: Is there a way to use VBA to update a linked picture of an excel table that is within the same workbook during the course of a subroutine?
This is the code I use to print the worksheet as a PDF:
wb.Worksheets("Weekly Report").ExportAsFixedFormat Type:=xlTypePDF, fileName:=print_file, Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=True
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
