IMAGE QUALITY

Prashanthiiii

New Member
Joined
Apr 19, 2023
Messages
1
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello,

I have been using the "Selection.ExportAsFixedFormat Type:=xlTypePDF" option for exporting Excel files to PDFs, but the quality is not very good.

Is there a way using VBA to have the Excel file exported or saved as an Adobe PDF with high quality?

Thank you in advance for your insight and help - as always!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hello!

Yes, there are several ways to export Excel files as PDFs with higher quality using VBA. Here are a few options:

  1. Use a third-party PDF printer driver: Instead of relying on the built-in PDF export feature of Excel, you can use a third-party PDF printer driver to create high-quality PDFs from your Excel file. Some popular options include Adobe Acrobat, NitroPDF, and Foxit PhantomPDF. Once you have installed the PDF printer driver, you can use VBA to print your Excel file to the PDF printer, like this:
VBA Code:
ActiveWorkbook.PrintOut copies:=1, ActivePrinter:="Adobe PDF"


  1. Adjust the PDF export options: Excel's built-in PDF export feature includes several options that can affect the quality of the resulting PDF. For example, you can adjust the resolution, compression, and color settings to improve the output quality. Here's an example VBA code that exports an Excel range to PDF with high quality:
VBA Code:
ActiveSheet.Range("A1:F30").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\MyFolder\MyPDF.pdf", _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=True, _
From:=1, _
To:=1, _
FixedFormatExtClassPtr:=0


Note the "Quality:=xlQualityStandard" parameter, which specifies the output quality level. You can experiment with different quality settings to find the one that works best for your needs.

  1. Use a PDF conversion tool: If you're still not satisfied with the quality of the PDF output, you can try using a dedicated PDF conversion tool to convert your Excel file to PDF. There are many such tools available, both free and paid, that can produce high-quality PDFs from Excel files. Some popular options include Adobe Acrobat Pro, Able2Extract, and PDF Converter Elite.
I hope this helps! Let me know if you have any further questions or need more assistance.
 
Upvote 0

Forum statistics

Threads
1,215,172
Messages
6,123,428
Members
449,099
Latest member
COOT

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