Hi all
PDF converter is supplied to us via an Excel/Sun interface called Vision. I can manually create a PDF within Excel 2002 by selecting the 'Vision PDF' printer and checking 'Print to file'. I get the usual dialog box requesting path and name to create the PDF. All works fine.
What I'm now trying to do is automate the process to create some 200 separate PDF docs. I've started writing a macro automating the above process, the code is as follows:
Sub print_PDF()
Application.ActivePrinter = "Vision PDF on LPT1:"
Worksheets(Array("MRA2", "HMA")).Select
ActiveWindow.SelectedSheets.PrintOut , , , , , printofile = True _
, , prtofilename = "c:\test.pdf"
End Sub
Upon executing the macro the PrintOut command results in the pages being sent to print (even the print job icon appears in the taskbar at the bottom of the screen) but then a Runtime error 1004 occurrs saying that it could not print on Vision PDF on LPT1. No PDF is created in the path requested.
I'm pretty sure the code is ok but that the PDF converter and prtofilename just don't want to work together.
Does anybody have any idea how to work around the problem?
BTW I don't write VBA 9-5 so please keep any solution real simple
TIA,
Steve S
Automating PDF print run in Excel 2002
Hello,
If you are using version 2.10 of the PDF Converter you need to call EnablePrinter before each printout.
Enable printer will take as parameters the License To and Activation code information you got when downloading a version of the Converter.
Please note that if you received the PDF Converter throught Vision, than you can use it only from inside this application. If you wish to use it from different applications, you need to license your own version of the PDF Converter.
If you are using version 2.10 of the PDF Converter you need to call EnablePrinter before each printout.
Enable printer will take as parameters the License To and Activation code information you got when downloading a version of the Converter.
Please note that if you received the PDF Converter throught Vision, than you can use it only from inside this application. If you wish to use it from different applications, you need to license your own version of the PDF Converter.