Thread: print macro
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default print macro

I understand the i variable, but you used a 1 when you concatenated the Ne0
and you used a periord (.) instead of a colon(:). If you used the period in
your actual code, it could affect the results. Sometimes the typos can be
as devastating as bad code.


"rbemmer" wrote in message
...
i = var
Each client's printer address is different when printing to the server.
The
"Ne0i" looks for that var. The prtTest() displays the address to the
default
printer on that local machine. What I'm looking for is a way to change the
default printer to a network printer, print my spreadsheet, then change
back
to the local default printer.

"JLGWhiz" wrote:

"\\SRVR01\Estimates on Ne0" & 1 & "."

Should this not be "\\SRVR01\Estimates on Ne0" & i & ":"

i instead of 1 and colon instead of period?



"rbemmer" wrote in message
...
Here's the code I'm using. Even with \\Server\Printer in the code the
macro
still prints to my local default printer instead of the network
printer.

For i = 1 To 99
Err.Clear
On Error Resume Next
Application.ActivePrinter = "\\SRVR01\Estimates on Ne0" & 1 & "."
If Err.Number = 0 Then Exit For

"JLGWhiz" wrote:

ActivePrinter = \\Servername\PrinterName


"rbemmer" wrote in message
...
Is there a way to write a macro that will change the default printer
on
my
local machine to a network printer ie... \\server\printer?