LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Printing Chart Sheet from a dialog box...

I have a workbook with a data table and several hidden charts.

I created a dialog box menu which has several pre-defined filters for the
data sheet and the ability to view the normally hidden charts. To keep
things simple for the user, I make sure that the chart is the only viewable
sheet when they select it... I hide all other charts including the data sheet.

I also have it coded so that when they close the dialog, it automatically
opens the data sheet and closes all open charts.

I want to put a Print Button on the dialog to print the various sheets.

Unfortunately, I can't get the print to execute without closing the dialog
first, running the print code, and reopening the form. This works fine for
printing the data sheet, but it won't work for printing the charts because I
hide all charts upon closing the dialog box so they don't get stuck in limbo.

Hence, I can't print the charts.

It seems like with a dialog box open, you can't change the focus of VBA to
the worksheet and that is where my problem lies.... Any ideas on how to make
this work would be appreciated.

Here's my code:
For reference, the dialog "ReportCard" is where I select different charts...
So when this button is clicked, the chart is already open. The other 2
menus are used to filter the data.

Private Sub cmdPrintPage_Click()
Unload Me
Call PrintThisPage("ReportCard")
End Sub

Sub PrintThisPage(menuname)
ActiveWindow.SelectedSheets.PrintPreview
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Select Case menuname
Case "Buyer"
BuyerMenu2.Show
Case "PTL"
PTLMenu2.Show
Case "ReportCard"
ReportCard.Show
End Select
End Sub

Thanks,
MikeZz



 
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
Hiding the 'printing' dialog box matpj Excel Discussion (Misc queries) 3 May 15th 06 08:31 AM
Suppressing or turning off the Printing dialog Jeff Lefebvre Excel Programming 4 February 8th 05 11:17 PM
Dialog sheet / Checkboxes Michael Beckinsale Excel Programming 3 January 18th 05 04:19 PM
Dialog Sheet not updating Macroman Excel Programming 0 November 27th 03 09:13 PM
Customisation of Chart Dialog Jon Peltier[_4_] Excel Programming 0 October 26th 03 01:13 AM


All times are GMT +1. The time now is 04:49 AM.

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

About Us

"It's about Microsoft Excel"