Solved

Excel 2007 VBA for Print to PDF

Posted on 2014-02-18
4
653 Views
Last Modified: 2014-03-04
Hello,

Do you have a simple string of code for selecting worksheets in excel and having them print to pdf?  I found that the NE port is different on all computers at my company so the code I did find only works on my computer.  Everything I find online also has the NE port reference (along with recording a macro).  Any way around this?

Thanks!
0
Comment
Question by:Escanaba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Kimputer
ID: 39867842
If you install PDFCreator (open source, free) you can just set

.ActivePrinter = "PDFCreator"

No need to fiddle with NE ports
0
 
LVL 1

Author Comment

by:Escanaba
ID: 39867857
Any other thoughts?  The financial company I work with has a strict policy of uploading new applications and to do so would take considerable amount of red tape.
0
 

Expert Comment

by:grasscake
ID: 39867873
I have the exact same issue and would be grateful for a solution.  The NE port is different for all computers, but installing PDFCreator is not an option.
0
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39867907
In that case, I would enumerate ALL printer (see: http://word.mvps.org/FAQs/MacrosVBA/AvailablePrinters.htm )

and using a partial match (assuming it's always a unique name, but only the NE port is different, like "PDF printer on NE6:), select the correct one from that list.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question