A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

macroprints two images



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2009, 09:24 PM posted to microsoft.public.excel.charting
[email protected]
external usenet poster
 
Posts: 1
Default macroprints two images


I have an activex command button, "CommandButton1" on Sheet1, which
issues
command "UserForm1.Show"; in Userform1 I have a command button,
"PrintIt"
with the single line "ActiveWorkbook.Sheets("Chart2").PrintPreview" in
the
_click event handler. (The same problem occurs with "printout", but
this way
I don't waste the paper.)

What happens is, I get the chart in the preview window, but it's as if
there
is a smaller version of the chart on top of a larger version. As I
indicated, if I use "...printout" instead of "...printpreview", it
prints
this way, too, i.e., with "2 images" of the chart, a smaller
superimposed on
a larger.

The same line, "ActiveWorkbook.Sheets("Chart2").PrintPreview" (or
..PrintOut), when attached directly to a command button on the
spreadsheet,
works as expected, with only one image of the chart.

Be warned: if you try this with "PrintPreview", it'll hang up the
sheet to
the point that only killing it from taskman will get you out.

here's the code for the button on the spreadsheet that calls
printpreview
itself

Private Sub CommandButton2_Click()
ActiveWorkbook.Sheets("Chart2").PrintPreview
End Sub

and here's the code that calls it from the command button on the
userform:

Private Sub cbPrintIt_Click()
ActiveWorkbook.Sheets("Chart2").PrintPreview
End Sub

And that's all the code there is in the entire workbook.

Thank you for any assistance
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.