Run Error 13

J

Jonsson

Hi,

Hi,
I have this code and get an error when run it on office97 in the line

Rows(i).EntireRow.Hidden = Range("A" & i).Value = 0


Dim i As Long
ActiveSheet.Select
ActiveSheet.Unprotect password:="!"
For i = 3 To 32
Rows(i).EntireRow.Hidden = Range("A" & i).Value = 0
Next i
ActiveSheet.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.Select
For i = 3 To 32
Rows(i).EntireRow.Hidden = False
Next i
ActiveSheet.Protect password:="!"
Range("A1").Select
End Function

It works at my office 2000 and also saving as office 95.
But when trying run the code in office 97 I get something like "erro
13" and "incompatible types"

I have checked VBA, Tools, Reference, and in 95 I have:

VB for applications
Microsoft excel 8.0 object library
Microsoft forms 2.0 object library
Microsoft office 8.0 object library

In office 2000 I have 9.0 instead of 8.0
Is that´s why I have this problem ? And if there is, is it a way aroun
it ?

any help is apprecciated.

//Thoma
 
Top