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: 683
Default Excel 2007 PrintPreview

Excel 97-2003 PrintPreview works - 2007 Excel does not

1. This code has worked for Excel 97-2003
2. The author of the code is not available
3. Do not get consistent results
3.A. User running Excel: Subscript out-of-range
3.B. User running Excel: Print, Next, Previous, Close grayed out but
Pages 1-7 indicator in left corner
* This has happened with Office SP1
3.C. Using the VBA IDE in Debug Mode shows a subscript index
out-of-range on the Split function

* Each sheet contains a chart

Code:

Sub Report_View()
Dim Page2 As String
Dim SplitToken As Variant
Dim SheetName As String

If Sheets("RawData").Range("A1") < "HEADER" Then
MsgBox "Please select a Test File first!"
Else
'Sheets("Parameters").Range("C10") = "SI"
'Calculate
Application.Calculate

usrMain.Hide

'Select the correct pages and do a print preview:
Select Case Sheets("Cu").Range("G2") / 6
Case Is <= 1
Page2 = "OverallReport_Page2-1"
Case Is <= 2
Page2 = "OverallReport_Page2-1,OverallReport_Page2-2"
Case Is <= 3
Page2 =
"OverallReport_Page2-1,OverallReport_Page2-2,OverallReport_Page2-3"
Case Is <= 4
Page2
"OverallReport_Page2-1,OverallReport_Page2-2,OverallReport_Page2-3,OverallReport_Page2-4"
Case Else
Page2
"OverallReport_Page2-1,OverallReport_Page2-2,OverallReport_Page2-3,OverallReport_Page2-4,OverallReport_Page2-5"
End Select


Sheets(Split("OverallReport,NetDP_vs_T,Eff_T_Plot, Eff_Avg_Plot,Eff_Avg_LogPlot,"
& Page2, ",", -1, 1)).Select
ActiveWindow.SelectedSheets.PrintPreview

Sheets("Home").Select
usrMain.Show
End If

End Sub

 
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
Excel PrintPreview shows fonts in different colour Technoguy Excel Discussion (Misc queries) 0 March 29th 10 07:35 AM
PrintPreview of multiple sheets under Excel 2007 Lucky[_5_] Excel Programming 1 May 30th 08 12:51 PM
PrintPreview problem in 2007 Corey ....[_2_] Excel Programming 1 May 21st 08 03:18 AM
PrintPreview in 2007 (for what it's worth...) rpw Excel Programming 0 April 24th 07 05:38 PM
.PrintPreview André Boileau Excel Programming 2 February 9th 07 02:31 AM


All times are GMT +1. The time now is 06:14 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"