Print Excel to PDF from Access

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 00:28
Joined
Dec 26, 2002
Messages
4,748
Okay access experts, I"m going to need some major help here. My company has created a new rule to force all reports into pdf format to "save space." Many of my reports go into excel templates I have set up from within Access using vba code. It would take forever to have to print every single one of these reports into a PDF from Excel. Does anyone have any ideas on how to do this programmatically? Here is what I"m thinking:

1. Access feeds information to Excel's hidden window.
2. The default printer is temporarily changed to the "Adobe PDF" using code.
3. The document is sent to the printer from within Access without even showing the window to the end user.
4. The name of the pdf is filled in automatically and saved to the user's desktop..Can this be done?

I await any advice on how to make this work. I already have code to change the default printer temporarily which should work fine, but I'm stuck on the rest fo now.

Thanks for any and all help!

Vassago
 
Well, there are ways to skin this cat, how many I don't know.

First ask yourself the question: If I weren't using Access, how would I do this? (Answer: Point to a file, click on some icon, ...)

Looking at icons and other things you do, determine from the respective HELP files of those programs whether they have command line options.

Using VBA, create a little script that when you run it, exercises the command line options of the programs to do the conversion.

OK, what if there is no command line option?

Then the next question is whether the program in question exposes itself (:eek:) to ActiveX / COM programming. If so, you can activate it as an application object, give it the name of the file you want to convert, and trigger your conversion that way.

If you have neither command line abilities nor COM/ActiveX exposure, you are out of luck.
 

Users who are viewing this thread

Back
Top Bottom