Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


.

Reply
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
Excel 2000 copy error Jim Excel Discussion (Misc queries) 1 March 25th 09 04:59 PM
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Solver error with Excel 2000? Dana DeLouis[_5_] Excel Programming 3 August 14th 03 06:15 AM
XP vs 2000 macro error Michael Miazga[_2_] Excel Programming 1 July 21st 03 09:08 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"