Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tasha,
In this situation, PrintPreview requires an array. This does the trick: Sub PreviewSheets() Dim myArray() Dim selCount With ActiveWindow selCount = .SelectedSheets.Count - 1 ReDim myArray(selCount) For t = 0 To selCount myArray(t) = .SelectedSheets(t + 1).Name Next ActiveWorkbook.Sheets(myArray).PrintPreview End With End Sub Stan Scott New York City "Tasha" wrote in message ... I have a macro that should show the selected sheet(s) in print preview. The macro is Sub Print_Click ActiveWindow.SelectedSheets.PrintPreview End sub The spread sheet that contains this macro is posted on our company intranet. When I click on the button on the spreadsheet from my hard drive there is no problem. When I click on it from the intranet I get Error 1004 method 'PrintPreview' not recognized for objects 'Sheets'. The PrintOut method works either on my hard drive or on the intranet but for some reason the PrintPreview does not. Any suggestions? TIA Tasha |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error 1004 (VBA) | Setting up and Configuration of Excel | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
VBA error - run-time error '1004': | Excel Programming |