'MS Access 2019 - How to fix "Microsoft Access can't save the output data to the file you've selected" [PDF Export]
I had a project that worked until recently and now I cannot export MS Access Report to PDF either manually via the Navigation Pane or Ribbon.
The only change that I can highlight is that our IT department upgraded us from MS Office 2016 to MS Office 2019.
I also cannot export the report via VBA.
When trying to export the report to PDF. I am receiving the following error message. Cannot figure our how to reset this
Microsoft Access can't save the output data to the file you've selected.
- The file may be open. If so, close it, and then save the output data to the file again.
- If you are using a template, check to make sure the template exists.
- If the file isn't open, check to make sure that you have enough free disk space.
- Make sure that the file exists on the path specified.
- Check to make sure you have permission to write to the specified folder.
Steps to recreate:
- Right Click on a report in the Navigation Pane > select export > PDF or XPS. Select a file location, give it a name and select PDF as a file type.
- Open a report in Print Preview > Select PDF of XPS from the Data Section of the Print Preview Ribbon, give it a name and select PDF as a file type.
- Open a report in Print Preview > Select EMAIL from the Data Section of the Print Preview Ribbon, Select PDF Format (*.pdf) from the Send Object As popup
- VBA Code
Docmd.OpenReport "MyReportName", acViewPreview,,,acHidden
DoCmd.OutputTo acOutputReport, "MyReportName", acFormatPDF, "c:\users\<myuser>\desktop\MyReportTrialRun_MMDDYYYY.pdf", , , , acExportQualityPrint
Docmd.Close acReport, "MyReportName"
(When running as part of the VBA process -- it just does not create the file no message)
System Configuration:
- MS Access - Microsoft Office Professional Plus 2019, Version 1808
- Build 10386.20017 Click-to-Run. Windows 10 Education Version 20H2
- Installed on 12/21/2021
- OS build 19042.1415
- Experience Windows Feature Experience Pack 120.2212.3920.0
- Processor Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz 3.30 GHz Installed RAM 16.0 GB
- System type 64-bit operating system, x64-based processor
- Internal Hard Drive has approx. 80GB of free space remaining
Troubleshooting Steps I Have Already Taken
- VBA Code Compiles without errors
- Compact and Repair Access Database File - No Change In Issue
- Tried to save with different file names - No Change In Issue
- Tried to save in different locations (other folders on desktop, other folders on local drive, on shared network drives and on external USB drives) - No Change In Issue
- Create A New Report using a subset of the data - No Change In Issue
- Ran Office Repair (Quick Repair) - No Change In Issue
- Ran Office Repair (Online Repair) - No Change In Issue
- Opened report in print preview, printed the report using the printer "Microsoft Print to PDF" -- got PDF
- Opened report and tried to export XPS file - received XPS file
- Opened report and tried to export to HTML - received HTML files
- Opened report and tried to export to Excel - received XLSX file
I am at a loss as to how to fix this issue.
Besides resolving this issue -- is there a way to via VBA "Print" to the "Microsoft Print to PDF" 'Printer' and specify where the file is saved? I need to do this automated since I send multiple reports via email and/or shared folders that I do not want to have to do the steps manually each run.
For disclosure > I previously posted on UtterAccess (https://www.utteraccess.com/topics/2063349/posts/2799785) looking for assistance with this issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

