Thanks for the reply,
All of the machines have Adove 6 or better installed on them. They all have the print driver installed.
Hi all, here's my problem:
I have an excel template thats stored on a server and used by multiple users on different machines. Inside the template, I have a button setup to print specific worksheets. The following code works fine on my machine (the machine it was created on), however, this same code does not work on another machine. I believe its because of the line "Application.ActivePrinter
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I found my own solution.
The example macros below shows how to get the full network printer name (useful when the network printer name can change) and print a worksheet to this printer:
Sub PrintToNetworkPrinterExamp
Dim strCurrentPrinter As String, strNetworkPrinter As String
strNetworkPrinter = GetFullNetworkPrinterName(
If Len(strNetworkPrinter) > 0 Then ' found the network printer
strCurrentPrinter = Application.ActivePrinter
' change to the network printer
Application.ActivePrinter = strNetworkPrinter
Worksheets(1).PrintOut ' print something
' change back to the previously active printer
Application.ActivePrinter = strCurrentPrinter
End If
End Sub
Function GetFullNetworkPrinterName(
' returns the full network printer name
' returns an empty string if the printer is not found
' e.g. GetFullNetworkPrinterName(
' might return "HP LaserJet 8100 Series PCL on Ne04:"
Dim strCurrentPrinterName As String, strTempPrinterName As String, i As Long
strCurrentPrinterName = Application.ActivePrinter
i = 0
Do While i < 100
strTempPrinterName = strNetworkPrinterName & " on Ne" & Format(i, "00") & ":"
On Error Resume Next ' try to change to the network printer
Application.ActivePrinter = strTempPrinterName
On Error GoTo 0
If Application.ActivePrinter = strTempPrinterName Then
' the network printer was found
GetFullNetworkPrinterName = strTempPrinterName
i = 100 ' makes the loop end
End If
i = i + 1
Loop
' remove the line below if you want the function to change the active printer
Application.ActivePrinter = strCurrentPrinterName ' change back to the original printer
End Function
Business Accounts
Answer for Membership
by: harr22Posted on 2009-09-26 at 17:29:12ID: 25432204
That will only work if the machine running it has the adobe print driver installed. Printing or saving to PDF is not native to excel. you would have to have a print driver set up on each machine that needs to do run this.
An alternative would be to have your code test if that line fails and if it does then prompt them to go install the driver.
I use this one b/c its free... http://www.primopdf.com/ Not sure if the Adobe option is available with their free reader version or if you would need the writer to use that.