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: 34
Default VBA error 1004

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
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
error 1004 (VBA) Harlan Grove Setting up and Configuration of Excel 0 May 15th 06 07:33 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
VBA error - run-time error '1004': Romanian37 Excel Programming 3 May 21st 04 03:25 PM


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