What is ExportAsFixedFormat?

What is ExportAsFixedFormat?

The ExportAsFixedFormat method is used to publish a workbook to either the PDF or XPS format.

How do I save a VBA file as a PDF?

How To Save An Excel File As PDF Using VBA: The ExportAsFixedFormat Method

  1. The Workbook. ExportAsFixedFormat method, when saving an Excel workbook as PDF.
  2. The Worksheet. ExportAsFixedFormat method, if you’re saving a worksheet as PDF.
  3. The Range. ExportAsFixedFormat method, when working with a Range object.
  4. The Chart.

How do I create a VBA Excel PDF?

From a VBA perspective, it is the ExportAsFilxedFormat method combined with the Type property set to xlTypePDF that creates a PDF.

  1. Save active sheet as PDF.
  2. Save active workbook as PDF.
  3. Save selection as PDF.
  4. Save a range as PDF.
  5. Save a chart as PDF.
  6. Notes for saving PDF documents.
  7. Loop through sheets.

How do I export a worksheet in Excel VBA?

Step 1: Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window. Step 2: Click Insert > Module, and paste the following macro in the Module Window: VBA : Export and save worksheets as new workbook in a new folder.

What is Run Time Error 1004?

Run time error ‘1004’ – programmatic access to visual basic project is not trusted. This error is due to the addition of a security option in the Office options by Microsoft. You can now open XLSTAT securely.

How do I use the command button to save the active worksheet as PDF in Excel?

Press the Alt + Q keys simultaneously to close the Microsoft Visual Basic for Applications window. Then turn off the Design Mode under the Developer tab. Now, click on the Command Button, the active worksheet will be saved as a PDF file named Export and located in the specified location.

How do I create a PDF from Excel?


  1. Open a workbook.
  2. On the File tab, click Save As.
  3. Click Browse.
  4. Select PDF from the drop-down list.
  5. Click Options.
  6. You can publish a selection, active sheet or entire workbook.
  7. Click OK and then Click Save.

How do I create a PDF from an Excel File?

To Export your Excel file as a PDF.

  1. Go to the File tab.
  2. Go to the Export tab.
  3. Select Create PDF/XPS Document.
  4. Press the Create PDF/XPS button.

How do I export a worksheet in Excel?

Save a single worksheet

  1. Right-click the worksheet name tab.
  2. Click select Move or Copy.
  3. Click on the Move selected sheets to Book drop-down menu. Select (new book).
  4. Click OK. Your new workbook opens with your moved worksheet.
  5. Click File > Save in your new workbook.

How do I extract a sheet in Excel?

1. Right click on the sheet tab (the worksheet you need to save as new file) in the sheet tab bar, then click Move or Copy. 2. In the Move or Copy dialog box, select (new book) from the To book drop-down list, check the Create a copy box, and then click the OK button.

How do I fix error 1004 in VBA?

What does ‘Error 1004: Programmatic access to Visual Basic Project is not trusted’ mean?

  1. Open a blank workbook in Excel.
  2. Go to File > Options > Trust Center.
  3. Click on Trust Center Settings…
  4. Under Macro Settings, make sure Trust access to the VBA project object model is checked.


Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top