ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run-time error 13 between Win NT and Win 2000 (https://www.excelbanter.com/excel-programming/273039-re-run-time-error-13-between-win-nt-win-2000-a.html)

Antje Crawford

Run-time error 13 between Win NT and Win 2000
 
The error occurs on this line ...
If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date,
1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" & weeknum
(Date, 1) Then


The Date_Range refers to "='30-31'!$B$3:$B$17", where 30-
31 is the particular sheet I was on when selecting the
specific range. I would like for the Date_Range to appear
on every sheet. How would that be accomplished?

The word 'Missing' does not appear in the VBE-References
checked.

The only machine that this code currently works is the
machine the code was created on. Any other machine I get
the type mismatch error.

TIA.
BR, Antje Crawford

From: Tom Ogilvy
Date Posted: 7/29/2003 10:28:00 AM

In the VBE, Look in tools=references and make sure no
references are shown
as MISSING.

Also, what line is highlighted when you get the error
message.

Does Date_Range appear on every sheet?

Regards,
Tom Ogilvy

"Antje Crawford" wrote in message
...
Hello,
I created the code below for the Workbook_Open event:
The problem I have is that when I run this code on a
Windows NT 4.0 machine it works without any errors, but

if
it is run on a Windows 2000 machine the run-time error

13:
type mismatch occurs.
Here is the code ...

Private Sub Workbook_Open()
Dim cell As Range
Dim wsh As Worksheet

For Each wsh In Worksheets
'Find worksheet for current period
If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date,
1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" & weeknum
(Date, 1) Then
wsh.Activate
'Loop through cells to highlight current date
For Each cell In Range("Date_Range")
If cell.Value = Date Then
cell.Font.Color = RGB(255, 0, 0)
End If
Next cell
End If
Next wsh
End Sub

Any suggestions?
All help is greatly appreciated.
TIA.
BR, Antje Crawford



Mike[_38_]

Run-time error 13 between Win NT and Win 2000
 
You need to install the Analysis toolpack to use the
Weeknum function. Simply select Tools/Add Ins from the
menu, and check Analysis Toolpak in the list. You might
need the installation CD.


-----Original Message-----
The error occurs on this line ...
If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date,
1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" &

weeknum
(Date, 1) Then


The Date_Range refers to "='30-31'!$B$3:$B$17", where 30-
31 is the particular sheet I was on when selecting the
specific range. I would like for the Date_Range to appear
on every sheet. How would that be accomplished?

The word 'Missing' does not appear in the VBE-References
checked.

The only machine that this code currently works is the
machine the code was created on. Any other machine I get
the type mismatch error.

TIA.
BR, Antje Crawford

From: Tom Ogilvy
Date Posted: 7/29/2003 10:28:00 AM

In the VBE, Look in tools=references and make sure no
references are shown
as MISSING.

Also, what line is highlighted when you get the error
message.

Does Date_Range appear on every sheet?

Regards,
Tom Ogilvy

"Antje Crawford" wrote in message
...
Hello,
I created the code below for the Workbook_Open event:
The problem I have is that when I run this code on a
Windows NT 4.0 machine it works without any errors, but

if
it is run on a Windows 2000 machine the run-time error

13:
type mismatch occurs.
Here is the code ...

Private Sub Workbook_Open()
Dim cell As Range
Dim wsh As Worksheet

For Each wsh In Worksheets
'Find worksheet for current period
If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date,
1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" &

weeknum
(Date, 1) Then
wsh.Activate
'Loop through cells to highlight current date
For Each cell In Range("Date_Range")
If cell.Value = Date Then
cell.Font.Color = RGB(255, 0, 0)
End If
Next cell
End If
Next wsh
End Sub

Any suggestions?
All help is greatly appreciated.
TIA.
BR, Antje Crawford


.



All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com