old macros not working properly

D

dcallaway

I am working with Excel (Office Pro 2003) and having issues (after updating
to XP SP3) with a Macro that was created in Excel 97. Run-time error:13 Type
Mismatch.
I have uninstalled Office and reinstalled to the release version
(11.5612.5605) - but continue to receive the error. I did not create the
spreadsheet - but have been trying to maintain macros and functions.
 
D

Dave Peterson

I think you're going to have to share the code and share the line that caused
the trouble.

And if the line refers to a range in a worksheet, you'll have to share what's in
that range.
 
D

dcallaway

Thanks Dave - this only part of the code - but this is the problem...It seems
to be in the date formatting.


Cells(65536, 1).End(xlUp).Offset(1, 0).Select
With ActiveCell
txtOrderID.Value = (txtOrderID.Value) 'Needs Ucase function
.Value = txtOrderID.Value
.Offset(0, 1).Value = IIf(optNew.Value, txtPrintDate.Value, "")
.Offset(0, 2).Value = txtShipDate.Value
.Offset(0, 3).Value = IIf(optNew.Value, "N", "U")
.Offset(0, 4).Value = IIf(optResidential.Value, "R",
IIf(optCommercial.Value, "C", IIf(optNextAce.Value, "N", "D")))
'optResidential.Value = True
.Offset(0, 5).Formula = "=IF(B" & ActiveCell.Row &
"="""","""",NETWORKDAYS(B" & ActiveCell.Row & ",C" & ActiveCell.Row &
",Holidays)-1)"
.Offset(0, 5).Value = .Offset(0, 5).Value
'If .Offset(0, 5).Value > 3 Then Range("F" &
ActiveCell.Row).Interior.ColorIndex = 46 'Orange color as warning
THIS IS THE LINE THAT IS HIGHLIGHTED: If .Offset(0, 5).Value > 9
Then Range("F" & ActiveCell.Row).Interior.ColorIndex = 3
 
D

Dave Peterson

I don't see anything in that line of code that would cause trouble.

But you didn't share what was in those cells when the code blew up.
 

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

Top