Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Default printer setup does not change printer in MS Project

Status
Not open for further replies.

technar

Technical User
Sep 6, 2011
9
AU
Hi,I have a list of projects in Excel and I have written a macro to run through the projects, open it one by one in MS Projects, manipulate the view and print to PDF file.

I have a line in the beginning of my code before I start looping through files:
Application.ActivePrinter = "Adobe PDF on NE01:"

However, it does not change printer when this line gets executed:
FilePrint FromDate:=FromDate, ToDate:=ToDate

It prints to "physical" printer not PDF.

Any ideas how to change it in VBA? (I setup Adobe PDF printer as default manually in "Printers and Faxes" before I run the macro at the moment)

Any help is appreciated!
 
I had a similar problem with attachmate and the only way I found to get around it was to manually print some PDF docs to get the default printer to be recognized. Sometimes it would require half a dozen or more before the default printer would stick.

I never found coding that would handle that problem, which sucks, but the manual work around did the trick.
 
it works if u set Adobe pdf printer as default before openning MS project But wont work through code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top