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.
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,618
Office Version
  1. 2007
Platform
  1. Windows
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: 1

YingFa

Board Regular
Joined
Nov 4, 2019
Messages
63
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?
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,618
Office Version
  1. 2007
Platform
  1. Windows
Try with all parameters:

VBA Code:
Wks.ExportAsFixedFormat xlTypePDF, FileSpec & "\" & File & ".pdf", _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
        :=False, OpenAfterPublish:=False
 

YingFa

Board Regular
Joined
Nov 4, 2019
Messages
63
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,147
Messages
5,623,008
Members
415,946
Latest member
bellerom

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
Top