PDF Complete

crich21

Registered User.
Local time
Today, 17:22
Joined
Jan 10, 2003
Messages
97
I have used this line of code for several years to output PDF reports.
I output multilple reports with this same method and it works on all but 1 PC.
I have one pc that has the PDF Complete app installed as there primary pdf viewer.
This is the only PC where this code fails. Has anyone experienced this? Workaround?

Code:
DoCmd.OutputTo acOutputReport, "rptFinishedGoods", acFormatPDF, strServerFileShareDir & "All-FG not Shipped.pdf", False

Error 2501
 
And 2501 is? :(
What does strServerFileShareDir contain?

Edit: I think Access uses it's own engine for creating the pdf?
 
Last edited:
Error code 2501 is "Action canceled" (which could also be more specific as to the action that was canceled.)

Since that machine has a different PDF processing utility it is reasonable to assume that the particular utility is not compatible with Access. You di8dn't say which version of Windows is in play here, but you can do this:

One any PC that is working and on the one that is failing, do the left-click on the Start Button and get to Settings >> Apps >> Default Apps. Look in the list of file types and their default app for the file type .PDF to see if the two machines are different in that particular setting.
 
I get
Code:
? error(2501)
Application-defined or object-defined error
 
Which version of Access is on the PC that is failing? Just wondering...

PS. If you use the following code, do you still get the same error?
Code:
DoCmd.OutputTo acOutputReport, "rptFinishedGoods", acFormatHTML, strServerFileShareDir & "All-FG not Shipped.html", True
 
Last edited:
After reading all the replies. All PC are windows 10 with the latest updates using Office 365.
Yes the default pdf app is different on the one pc. I understand that access creates its own pdf.
All my reports worked fine on the affected PC up until recently, with no changes to the database at all. Been using
the same front end for almost a year now.
Yes my report opens fine on the affected PC if I change the format of the output. ex. acFormatHtml or any other format.
I was curious if anyone had input as to why access creating its own pdf would be affected by different pdf viewers?
Is there another way to create the pdf?
 
What happens if you give it your own extension like pdff and then use Open with?

I had a situation when I was volunteering with the local Community Car Scheme.
I had written VBA to print names and addresses via Word mailmerge.

However the controller was using one of those Office lookalikes, and that of course could not interpret VBA.
So we uninstalled the whole suite and they got a copy of Office instead.

However it still would not work, and checking the reg entries for references, the copy program was still in the system. :mad:
It really acted like a virus. :(

So I just got the latest Excel workbook from the controller and printed off the address sheets he needed using the code, and emailed them back.

We meant to get to the bottom of it, but the changes were not that frequent, and then I quit, due to driving around at 20mph all the time. :(

So I am wondering if the Complete PDF has taken over the actual creation of a pdf file? :unsure:
 
Yes the default pdf app is different on the one pc. I understand that access creates its own pdf.

The difficulty may be that the rendering is being done via the "special version" PDF that is unique on your PC, but you don't have the appropriate support library file installed for that particular renderer. If you are using this "alien flavor" of PDF converter, it may be that you have not exposed its COM interface (library file) and so Access cannot issue commands to the PDF converter - because you would still be using the standard commands from the default converter that comes with Access.

This might require some research, but... if you can find the original delivery package and it has a user's guide, OR if you have a document that is a user's guide as part of that product's distribution kit, you MIGHT want to see if there is a library file available. Most likely, it would be a .DLL file.

IF there is such a file, then open your project and get onto any VBA page. From there, use the Tools >> References options to find the new PDF product libraries. Set a reference (check the box) for the "special PDF utility" converter, whatever the product's actual name, and see if that helps. If you DON'T have a support library for this product, you might not be able to use it as the default app for file type .PDF, though you could still use it manually.
 
Is there another way to create the pdf?
Just as another way of troubleshooting, could you try manually creating the pdf? So, on the affected machine, open the report in print preview. Then, click on the PDF button on the ribbon. Does it work?
 
Just as another way of troubleshooting, could you try manually creating the pdf? So, on the affected machine, open the report in print preview. Then, click on the PDF button on the ribbon. Does it work?
Yes it does work using this method. That was my first thought. So, I believe it has something to do with what @Gasman was saying about PDF Complete taking over the creation of the PDF. However since its not opening the app, it fails.

I will try and figure out if PDF Complete can be incorporated or referenced by Access in some way. I have reached out to PDF Complete support as well. I will report back. Thanks everyone for the suggestions.
 

Users who are viewing this thread

Back
Top Bottom