PC Review


Reply
Thread Tools Rate Thread

BUG: print command from command button in userform causes double c

 
 
Mike Jamesson
Guest
Posts: n/a
 
      10th Aug 2009
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.

There is no such problem in Excel 2003, i.e., a command button on a userform
can successfully call "printout" (or "printpreview") without creating a
deformed double 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform Command Button sarndt Microsoft Excel Programming 3 26th Feb 2010 10:33 PM
print command from command button in userform causes double chart Mike Jamesson Microsoft Excel Programming 5 11th Aug 2009 03:42 AM
Userform Command Button not available until another command buttonhas been used MiataDiablo@gmail.com Microsoft Excel Programming 4 4th Sep 2008 04:35 PM
command button, userform Richard Microsoft Frontpage 1 1st Sep 2008 02:20 AM
Opening a Userform from a command button maclachlan Microsoft Excel Programming 1 14th Mar 2004 10:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:14 AM.