View Single Post
  #3   Report Post  
Posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
Robert Baer Robert Baer is offline
external usenet poster
 
Posts: 93
Default Excel print object?

Paul wrote:
Robert Baer wrote:
Â* Snippet of incomplete program:
*COPY*
Â*Â*Â* ActivePrinter = "Acrobat PDFWriter on FILE:": PrintToFile = True
'note need KILL statement for PDFWriter
' Above sets printer in Excel 2003; WILL crash in Excel 2010.

Â*num = 1Â*Â*Â* 'here we try to select the diagram only; hope printer will
use that
Â*For Each iobj In ActiveSheet.ShapesÂ*Â*Â* 'DrawingObjects
Â* iobj.Select
Â* If num = 5 Then
Â*Â* Exit ForÂ*Â* 'got inserted "Picture 3"; want to print only this
Â* End If
Â* num = num + 1
Â*Next iobj
Â*'Â* So..how do we pass it on?

' In "modern" defective Excel 2010, prints to default SO must set
default to what is needed
'Â*Â*Â* ActivePrinter = "Xerox Phaser 6120 PS on FILE:": PrintToFile = True
Â*Â*Â* ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False, _
Â*Â*Â* Collate:=False, PrToFilename:=pPath + vNamÂ* 'use + ".PS" for Xerox
printer
Â*Â*Â* Kill pPath + vNamÂ*Â* 'not needed for PS printer
*END COPY*

Â* So..how do we pass it on or select it or whatever for printing?

Â*Â* Thanks


Did you go looking for example code ?

https://stackoverflow.com/questions/...ting-excel-vba


They present an overview of sorts about .select here.

Note that the HTML formatting applied here, may require you
to test multiple browsers to get a copy clean enough to read.
Seamonkey = screwy, Chromealike = OK.

https://stackoverflow.com/questions/...excel-vba?rq=1


Â*Â* Paul

Well, i looked at those and others.
Everybody refers to ranges or cells or sheets or ...
BUT not at an actual object.
Using fake code, iobj.5 is also known as "Picture 3", which was
inserted from an external source.
The For Each iobj loop was the only way i discovered how to get at it.
I want to print it after i made changes by moving other objects into
and out of it.

Thanks