View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default print command from command button in userform causes double chart

It sounds like you have inadvertantly added a second chart to
Sheets("Chart2").



"Mike Jamesson" wrote in message
...
Excel 2007, SP2

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.

I can provide a sample if that helps, but there doesn't appear any place
to
put an attachment.