View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
amirstal amirstal is offline
external usenet poster
 
Posts: 35
Default Basic VBA Question

Thanks.
I could not get it to work.
This is how I tried:

Sub PrintBlotter()
'
' PrintBlotter Macro
' Macro recorded 12/18/2006 by Reuters LTD
'
Print Application.ActivePrinter
//IDB-NY509-04-TRADER-4600C
ActiveSheet.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
'
End Sub

But I got the following message:
Compile error:
Method not valid without suitable object.

Thanks,

Amir
Tom Ogilvy wrote:
Select the printer you want.

then in the immediate window to

? application.ActivePrinter

for example:
? application.ActivePrinter
\\ARDAPS01\1D373C on Ne03:

Now use this string to set the activeprinter (of course capture the default
and set it back after printing).

--
Regards,
Tom Ogilvy


"amirstal" wrote:

Thanks. That works perfectly.
Can I also make the code choose a specific printer to print from? I
want to direct the prints to a different printer than the default...



Tom Ogilvy wrote:
Activesheet.PrintOut From:=1, To:=1, _
Copies:=1, Collate:=True


Range("A1:B5").Printout

or selection.Printout

--
Regards,
Tom Ogilvy


"amirstal" wrote:

What is the code I need to write in order to:
1. Print the first page of an active worksheet?
2. Print a selected range (A1:B5 for example) of an active worksheet?

Thanks.