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
Solved

Excel 2007 VBA for Print to PDF

Posted on 2014-02-18
4
647 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

790 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