View Single Post
  #3   Report Post  
Old February 7th 20, 08:57 PM posted to,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
Robert Baer Robert Baer is offline
external usenet poster
First recorded activity by ExcelBanter: Dec 2007
Posts: 89
Default Excel print object?

Paul wrote:
Robert Baer wrote:
┬* Snippet of incomplete program:
┬*┬*┬* 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
┬*'┬* 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
┬*┬*┬* Kill pPath + vNam┬*┬* 'not needed for PS printer

┬* do we pass it on or select it or whatever for printing?

┬*┬* Thanks

Did you go looking for example code ?

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.

┬*┬* 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.