VBA code to export excel as PDF does not export it with images

YingFa

Board Regular
Joined
Nov 4, 2019
Messages
63
Hello,

I am using this code Wks.ExportAsFixedFormat xlTypePDF, FileSpec & "\" & File & ".pdf", but if I place images on the excel, it does not export the on the PDF file. Can I have your help on this? I need the pdf to be exported with the images placed on the excel file.

Thank you.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Right-click the picture, then click the Size and Properties option. This is going to open a new window.
Select Properties tab.
Check Print Object option.

1595597464066.png
 

Attachments

  • 1595597358711.png
    1595597358711.png
    115.5 KB · Views: 2
Upvote 0
Hi, thank you for your reply on this. The print object is checked but it still does not work. The excel file is exported as a PDF without images. Is there any code to print as PDF instead of saving as pdf?
 
Upvote 0
Try with all parameters:

VBA Code:
Wks.ExportAsFixedFormat xlTypePDF, FileSpec & "\" & File & ".pdf", _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
        :=False, OpenAfterPublish:=False
 
Upvote 0
Try with all parameters:

VBA Code:
Wks.ExportAsFixedFormat xlTypePDF, FileSpec & "\" & File & ".pdf", _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
        :=False, OpenAfterPublish:=False
Hi, sorry for the late reply. I think I overlooked your response. I have tried the code but even though I have images on the excel from, they are not exported when the excel is converted to PDF. Any idea why?
 
Upvote 0

Forum statistics

Threads
1,215,632
Messages
6,125,913
Members
449,274
Latest member
mrcsbenson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top