Access 2013 VBA DoCmd.OutputTo failed to create PDF, but the same code works in Access 2010

I have this Access 2010 VBA code that works on computer with Access 2010, but got error on computer with Access 2013 or 2016:

DoCmd.OpenReport "rptArchiveRequest", acViewPreview
DoCmd.OutputTo acOutputReport, "rptArchiveRequest", acFormatPDF, "C:\ArchiveRequest.pdf", False

Open in new window

The error reads:
"Run-time error '2282':
The  format in which you are attempting to output the current object is not available"

If I replace acFormatPDF with acFormatRTF then it works on all versions of Access. But I do need PDF format.
Also, the Intellisense doesn't List Properties/Methods for OutputFormat parameter (on Access 2013 and Access 2016 computers).

Do you know what causes it and how to resolve this error?

Thank you.
Tram PhamAsked:
Who is Participating?
 
Tram PhamAuthor Commented:
Crystal,

Thank you for your suggestions. They are not a direct solution, but they lead me to find the solution. I followed your first suggestion to add the Acrobat tab to Access 2016. I didn't see the PDFMaker Office Addin in the Access COM Add-ins list, tried to add it (using same path as in Excel/Word/PP 2016), but couldn't add it in.  When I Googled this issue, I found the answer to my original problem in this discussion on Adobe forum:

https://forums.adobe.com/message/9735747#9735747

The answer is: There is no longer support for PDF Maker in Access after Access 2010 and Acrobat X (10), even though there is PDF Maker for other Office apps in Office 2013 and 2016 such as Word, Excel, PowerPoint, Outlook...

I really appreciate your continued support and suggestions for me till the end, Crystal.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Tram,

when the problem happens, it is on a computer with an installation (new?) that perhaps does not have any program to render PDF?

to test:
in Windows Explorer or My Computer:
double-click on a PDF file from that computer ... does it open? if so, how? if not, what happens?

The first step to fix is to make sure the file type is recognized and can open properly

have an awesome day,
crystal
0
 
Tram PhamAuthor Commented:
Hi Crystal,

Thank you so much for replying! The problem happens on 2 computers - 1 is user computer with MS Office 2013 (not new) and Acrobat Distiller, 1 is a test VM with MS Office 2016 and Acrobat Pro. I have verified that they both can read and create PDF files.

Am I the only one to have this problem, since I can't find any similar problem/question searching online? I've seen similar error with earlier version of Office (before 2007)

I would appreciate any tip or suggestion to troubleshoot this problem.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
if you double-click on a PDF file in Windows Explorer or My Computer, does it open? If so, what if you also put a PDF reader on those machines?
0
 
Tram PhamAuthor Commented:
I double-clicked a PDF file on the VM with Office 2016 -> it was opened in Acrobat Pro. I then installed the Acrobat Reader, and double-clicked to open the file again. This time, it was opened in Acrobat Reader.

The user computer that I  have problem with, has Office 2013 and both Acrobat Reader and Acrobat Pro. When he double-clicked a PDF file, it was opened in Acrobat Pro.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Tram,

> "The user computer that I  have problem with, has Office 2013 and both Acrobat Reader and Acrobat Pro. When he double-clicked a PDF file, it was opened in Acrobat Pro."

Change the default application associated with PDF:

have that user right-click a PDF file in Windows Explorer or My Computer and choose --> Open With

if Reader is not on the short list, then click 'Choose another app' from the bottom and pick Adobe Reader. AND check: 'Always use this app to open PDF files"

The reason it probably worked for the first case* is that Acrobat Reader was more recently installed and took over the file extension as the default.

* did that enable Access to work right for OutPutTo also?

have an awesome day,
crystal
0
 
Tram PhamAuthor Commented:
Hi Crystal,
Thank you for being with me on this. To clarify the situation, both cases above - Office 2013 with default Acrobat Reader and Office 2016 with default Acrobat Pro - fail at OutputTo command code. It only works on Office 2010 computer, with either Acrobat Pro or Acrobat Reader alone.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Tram,

on the computer with both Pro and Reader where it does not work, what is the default application for Windows for PDF files? I do not know if this makes a difference ... only guessing. since when Reader is installed last, it seems to work ok?

have an awesome day,
crystal
0
 
Tram PhamAuthor Commented:
Crystal,
Office 2010 is the current Office version for the whole company. Some computers have Acrobat Pro, some have Acrobat Reader, on which the program runs fine. A few people are using Office 2013 (as needed for their work), and we are testing Office 2016 to prepare for company wide upgrade. In these 2 cases, either they have Acrobat Reader or Acrobat Pro or both, the program fails. So, I am pretty sure it is the version of Office/Access that causes the failure. But I don't know why or what is missing.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Tram,

here is a page with instructions to activate PDF for Office 2016:

Get the Adobe Acrobat tab to appear
Applies To: Excel 2016 Word 2016 Office 2016 Excel 2013 Word 2013 Office 2013

https://support.office.com/en-us/article/get-the-adobe-acrobat-tab-to-appear-b83cbba3-7bc1-4c75-b8dc-511e07a283f0

if you do this in, Word, for instance, it should ripple over to the other Office products like Access.

~~~
here is another thing to check:

Control Panel > Devices and Printers

do you see "Print as PDF"? or "Microsoft Print to PDF"?

~~~
... or maybe this explains the problem?
Incompatibilities between Office programs and Adobe Acrobat PDFMaker Office COM Addin
https://support.microsoft.com/en-us/help/2800094/incompatibilities-between-office-programs-and-adobe-acrobat-pdfmaker-o


have an awesome day,
crystal
1
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
you're welcome, Tram ~ happy to help
0
 
Tram PhamAuthor Commented:
Following Crystal's suggestion, I encountered another issue. In search for this issue's solution, I found the explanation to my original issue. Just explanation,  not solution, because what I want to do can't be done anymore, due to Adobe dropping its support for the newer Access versions.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.