Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old February 7th 20, 09:01 AM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Dec 2007
Posts: 93
Default Excel print object?

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

  #2   Report Post  
Old February 7th 20, 10:36 AM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 5
Default Excel print object?

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
  #3   Report Post  
Old February 7th 20, 08:57 PM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Dec 2007
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
  #4   Report Post  
Old February 8th 20, 05:20 PM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,152
Default Excel print object?

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.


When I modify/markup an image in Excel I take a ScreenCapture of it and convert
that to whatever image format I'm after. Since this is the only contents on a
worksheet, the normal Print processes work as expected for printing the
finished result.

Normally, I set the sheet up like graph paper and turn Gridlines off.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #5   Report Post  
Old February 9th 20, 07:27 AM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Dec 2007
Posts: 93
Default Excel print object?

GS wrote:
* 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.


When I modify/markup an image in Excel I take a ScreenCapture of it and
convert that to whatever image format I'm after. Since this is the only
contents on a worksheet, the normal Print processes work as expected for
printing the finished result.

Normally, I set the sheet up like graph paper and turn Gridlines off.

I have a loop around the basic generator to produce 200 patterns that
i want to save, and using a PDF printer to FILE: allows the computer to
do all of the work (like it should do).

Even for one pass, I cannot get it to print that object; so the
normal Print processes does NOT work properly; it prints the whole page.

Your last line indicates that you refer to sheets (like i said), not
an object/picture.

The For Each iobj loop selects the desired object(picture); how do i
complete the process to print it?

Thanks.





  #6   Report Post  
Old February 9th 20, 04:52 PM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,152
Default Excel print object?

GS wrote:
* 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.


When I modify/markup an image in Excel I take a ScreenCapture of it and
convert that to whatever image format I'm after. Since this is the only
contents on a worksheet, the normal Print processes work as expected for
printing the finished result.

Normally, I set the sheet up like graph paper and turn Gridlines off.

I have a loop around the basic generator to produce 200 patterns that i
want to save, and using a PDF printer to FILE: allows the computer to do all
of the work (like it should do).

Even for one pass, I cannot get it to print that object; so the normal
Print processes does NOT work properly; it prints the whole page.

Your last line indicates that you refer to sheets (like i said), not an
object/picture.

The For Each iobj loop selects the desired object(picture); how do i
complete the process to print it?

Thanks.


I ScreenCapture, as I said, then convert to the image format I want. There is
only 1 image per page, so if you want individual printouts then Insert
PageBreak after each image.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #7   Report Post  
Old February 9th 20, 11:30 PM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Dec 2007
Posts: 93
Default Excel print object?

GS wrote:
GS wrote:
* 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.

When I modify/markup an image in Excel I take a ScreenCapture of it
and convert that to whatever image format I'm after. Since this is
the only contents on a worksheet, the normal Print processes work as
expected for printing the finished result.

Normally, I set the sheet up like graph paper and turn Gridlines off.

** I have a loop around the basic generator to produce 200 patterns
that i want to save, and using a PDF printer to FILE: allows the
computer to do all of the work (like it should do).

** Even for one pass, I cannot get it to print that object; so the
normal Print processes does NOT work properly; it prints the whole page.

** Your last line indicates that you refer to sheets (like i said),
not an object/picture.

** The For Each iobj loop selects the desired object(picture); how do
i complete the process to print it?

** Thanks.


I ScreenCapture, as I said, then convert to the image format I want.
There is only 1 image per page, so if you want individual printouts then
Insert PageBreak after each image.

Computers are supposed to be able to automate repetitive
(programming) tasks.
I create 200 different "Picture 3" (fifth iobj) and need to print
each one.
But i cannot print even one without code to do that.
For me to screen capture each one is manifestly stupid for me.

Do you have any clue as to what excel code to use for printing that
object?

Thanks.



  #8   Report Post  
Old February 10th 20, 06:13 AM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,152
Default Excel print object?

Computers are supposed to be able to automate repetitive (programming) tasks.
I create 200 different "Picture 3" (fifth iobj) and need to print each
one.
But i cannot print even one without code to do that.
For me to screen capture each one is manifestly stupid for me.

Do you have any clue as to what excel code to use for printing that
object?


What I do with ScreenCapture has nothing to do with what you want to do
print-wise. IF YOU PUT A PAGE BREAK AFTER EACH IMAGE as I suggested and use
normal print process, individual pages will be printed ONE IMAGE PER PAGE!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #9   Report Post  
Old February 10th 20, 12:36 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2011
Posts: 3,762
Default Excel print object?

Hi Robert,

Am Fri, 7 Feb 2020 00:01:05 -0800 schrieb Robert Baer:

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.


only workbook, worksheets, sheet ranges and charts can be exported to
PDF.

Try:

Sub PrintShapes()
Dim shp As Shape
Dim i As Integer
Dim varShp() As Variant

'Modify here the path to save the pdf
Const myPath = "C:\Users\claus\Desktop\"
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
'Modify the sheet name
With Sheets("Sheet1")
For Each shp In .Shapes
ReDim Preserve varShp(i)
varShp(i) = shp.Name
i = i + 1
Next

Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = "Temp"

For i = LBound(varShp) To UBound(varShp)
With Charts.Add
.SetSourceData Source:=Sheets("Temp").Range("A1")
.Location whe=xlLocationAsObject, Name:=Sheets("Temp").Name
End With
.Shapes(varShp(i)).Copy
Sheets("Temp").ChartObjects(1).Chart.Paste
With Sheets("Temp").Shapes(1)
.Height = Sheets("Sheet1").Shapes(varShp(i)).Height + 1
.Width = Sheets("Sheet1").Shapes(varShp(i)).Width + 1
End With

Sheets("Temp").ChartObjects(1).Chart.ExportAsFixed Format Type:=xlTypePDF, Filename:= _
myPath & varShp(i) & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Sheets("Temp").ChartObjects(1).Delete
Next
Sheets("Temp").Delete
End With
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub


Regards
Claus B.
--
Windows10
Office 2016
  #10   Report Post  
Old February 11th 20, 08:29 AM posted to alt.computer,microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.printing,microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Dec 2007
Posts: 93
Default Excel print object?

GS wrote:
Computers are supposed to be able to automate repetitive (programming)
tasks.
** I create 200 different "Picture 3" (fifth iobj) and need to print
each one.
** But i cannot print even one without code to do that.
** For me to screen capture each one is manifestly stupid for me.

** Do you have any clue as to what excel code to use for printing that
object?


What I do with ScreenCapture has nothing to do with what you want to do
print-wise. IF YOU PUT A PAGE BREAK AFTER EACH IMAGE as I suggested and
use normal print process, individual pages will be printed ONE IMAGE PER
PAGE!

One has to GET the image first. At present i have no way to transfer
the fifth iobj as an image to anything, so it is moot.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I print an object in Excel 2007 MAF Excel Discussion (Misc queries) 2 April 4th 09 03:40 AM
Print Word Object in Excel Mac Excel Discussion (Misc queries) 7 March 2nd 07 06:12 PM
Why does a pasted object in Excel sometimes print upside down? Mel Excel Discussion (Misc queries) 2 December 2nd 05 03:07 PM
Print more then one page in excel from a word object Alex Martinez Excel Worksheet Functions 0 October 14th 05 06:22 AM


All times are GMT +1. The time now is 12:38 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright ©2004-2020 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017