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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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,214,813
Messages
6,121,706
Members
449,049
Latest member
THMarana

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