Run Error 13

  • Thread starter Thread starter Jonsson
  • Start date Start date
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
 
Your code ran for me in Excel 97. Of course I don't know what values you
have in column A. In addition to the references you mentioned, I also have
a reference to Visual Basic for Applications. The references' versions is
not the problem. 8 is for Excel 97, 9 for Excel 2000, 10 for Excel 2002 and
11 for Excel 2003.

--
Jim Rech
Excel MVP
|
| 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 "error
| 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 around
| it ?
|
| any help is apprecciated.
|
| //Thomas
|
|
| --
| Jonsson
| ------------------------------------------------------------------------
| Jonsson's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=5472
| View this thread: http://www.excelforum.com/showthread.php?threadid=275299
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top