Excel Print Preview toolbar sometimes disabled
Results 1 to 3 of 3

Thread: Excel Print Preview toolbar sometimes disabled

  1. #1
    Join Date
    Aug 2003
    Location
    burnaby
    Posts
    976

    Excel Print Preview toolbar sometimes disabled

    I'm very confused on a problem that the Print Preview toolbar is sometimes disabled. Please help.

    I have a Excel 2007 xlsm in which a user-interface is built to run VBA codes. The interface has 3 buttons for user to select 2 files for importing, 1 folder and then enter a file name for exporting. Codes are run w/o problem and the calculations are manually checked OK. 3 worksheets are produced to show the calculation. At the end of the processing, the program will set the print area of each sheet according to the no. of data rows (which varies depending on the size of imported data, the no. of columns is fixed). When the program is completed, the user interface still displays pending for user's further action: EXIT or PRINT PREVIEW.

    The interface has a Print Preview button for user to activate. On clicking it, the 3 result sheets will be shown in print preview mode one by one (when user closes 1, the next will show up). However, the Print Preview toolbar displays erratically - sometimes dimmed out (all buttons disabled) but sometimes is normal (user can print or see print setup).

    The codes for print preview are:
    Private Sub cmdPreview_click()
    ' preview 3 reports
    Me.Hide

    ' set print area for Monthly Report
    Worksheets("REPORT 1").Select
    Worksheets("REPORT 1").PrintPreview

    Worksheets("REPORT 2").Select
    Worksheets("REPORT 2").PrintPreview

    Worksheets("REPORT 3").Select
    Worksheets("REPORT 3").PrintPreview

    Worksheets("REPORT 1").Select

    Me.Show
    End Sub

    Please help me to resolve this strange problem. Thanks.

  2. #2
    Join Date
    Feb 2000
    Location
    Idaho Falls, Idaho, USA
    Posts
    18,063
    An intermittent error like that might be hard to track down. You might try your question at the link below:

    http://www.vbforums.com/forumdisplay...ysprune=2&f=37

  3. #3
    Join Date
    Aug 2003
    Location
    burnaby
    Posts
    976
    Thanks jdc2000.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •