Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Runtime error only with Office 97 - advice required

Hello

A file containing macros runs fine in Excel 2000 but I receive a run-time
error when the same code is run in Excel 97.

The run-time error is run-time error 13
Type mismatch

the line of code causing this is

If ActiveCell.Offset(0,14).Value<0 Then

could anyone advise me on how to make the code run under Excel 97

Regards
Kenny

Below is a larger chunk of the code

Private Sub CommandButton8_Click()

If LogEntry.TextBox2.Value = "" Then
MsgBox "There is nothing to sign off"

MyClearBoxes

Exit Sub
End If



If ActiveCell.Offset(0, 14).Value < 0 Then
MsgBox "This defect has already been signed off!"


MyClearBoxes

Sheets("Data").Range("A2").Activate
Exit Sub
End If

Select Case LogEntry.TextBox6.Value
Case "001": ActiveCell.Offset(0, 14).Value = "Kenny Wharton"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value


MyClearBoxes


Case "002": ActiveCell.Offset(0, 14).Value = "Karl Eason"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value

MyClearBoxes


Case "003": ActiveCell.Offset(0, 14).Value = "Len Stobbs"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value

MyClearBoxes


Case Else:

MsgBox "Password failed - Unable to show as RECTIFIED"
ActiveCell.Offset(0, 14).Value = ""
ActiveCell.Offset(0, 12).Value = ""
ActiveCell.Offset(0, 11).Value = ""

response = MsgBox("Do you want to enter another record?", vbYesNo)
If response = vbYes Then

MyClearBoxes

Else
Unload LogEntry
ThisWorkbook.Save
Application.Quit

End If
End Select


End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Runtime error only with Office 97 - advice required

Try setting the TakeFocusOnClick property of the button to False....

--
Regards

Juan Pablo González

"Kennyatwork" wrote in message
...
Hello

A file containing macros runs fine in Excel 2000 but I receive a run-time
error when the same code is run in Excel 97.

The run-time error is run-time error 13
Type mismatch

the line of code causing this is

If ActiveCell.Offset(0,14).Value<0 Then

could anyone advise me on how to make the code run under Excel 97

Regards
Kenny

Below is a larger chunk of the code

Private Sub CommandButton8_Click()

If LogEntry.TextBox2.Value = "" Then
MsgBox "There is nothing to sign off"

MyClearBoxes

Exit Sub
End If



If ActiveCell.Offset(0, 14).Value < 0 Then
MsgBox "This defect has already been signed off!"


MyClearBoxes

Sheets("Data").Range("A2").Activate
Exit Sub
End If

Select Case LogEntry.TextBox6.Value
Case "001": ActiveCell.Offset(0, 14).Value = "Kenny Wharton"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value


MyClearBoxes


Case "002": ActiveCell.Offset(0, 14).Value = "Karl Eason"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value

MyClearBoxes


Case "003": ActiveCell.Offset(0, 14).Value = "Len Stobbs"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value

MyClearBoxes


Case Else:

MsgBox "Password failed - Unable to show as RECTIFIED"
ActiveCell.Offset(0, 14).Value = ""
ActiveCell.Offset(0, 12).Value = ""
ActiveCell.Offset(0, 11).Value = ""

response = MsgBox("Do you want to enter another record?", vbYesNo)
If response = vbYes Then

MyClearBoxes

Else
Unload LogEntry
ThisWorkbook.Save
Application.Quit

End If
End Select


End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Runtime error only with Office 97 - advice required

If the value of the cell is not numeric, then you will get this error in
xl97

if isnumeric(activecell.offset(0,14)) then
If ActiveCell.Offset(0,14).Value<0 Then

End if
End if

--
Regards,
Tom Ogilvy


"Kennyatwork" wrote in message
...
Hello

A file containing macros runs fine in Excel 2000 but I receive a run-time
error when the same code is run in Excel 97.

The run-time error is run-time error 13
Type mismatch

the line of code causing this is

If ActiveCell.Offset(0,14).Value<0 Then

could anyone advise me on how to make the code run under Excel 97

Regards
Kenny

Below is a larger chunk of the code

Private Sub CommandButton8_Click()

If LogEntry.TextBox2.Value = "" Then
MsgBox "There is nothing to sign off"

MyClearBoxes

Exit Sub
End If



If ActiveCell.Offset(0, 14).Value < 0 Then
MsgBox "This defect has already been signed off!"


MyClearBoxes

Sheets("Data").Range("A2").Activate
Exit Sub
End If

Select Case LogEntry.TextBox6.Value
Case "001": ActiveCell.Offset(0, 14).Value = "Kenny Wharton"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value


MyClearBoxes


Case "002": ActiveCell.Offset(0, 14).Value = "Karl Eason"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value

MyClearBoxes


Case "003": ActiveCell.Offset(0, 14).Value = "Len Stobbs"
LogEntry.TextBox5.Value = Format(Now(), "D MMM YYYY HH:MM")
ActiveCell.Offset(0, 12).Value = LogEntry.TextBox5.Value
ActiveCell.Offset(0, 11).Value = LogEntry.TextBox4.Value

MyClearBoxes


Case Else:

MsgBox "Password failed - Unable to show as RECTIFIED"
ActiveCell.Offset(0, 14).Value = ""
ActiveCell.Offset(0, 12).Value = ""
ActiveCell.Offset(0, 11).Value = ""

response = MsgBox("Do you want to enter another record?", vbYesNo)
If response = vbYes Then

MyClearBoxes

Else
Unload LogEntry
ThisWorkbook.Save
Application.Quit

End If
End Select


End Sub




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
Runtime error '424': Object Required loren.pottinger Excel Discussion (Misc queries) 1 August 28th 06 09:56 PM
"Microsoft Visual Basic runtime error '424' object required". SharonG. Excel Worksheet Functions 0 July 5th 06 01:36 AM
MS Office error message, "a required .DLL file, MSO97.DLL ..." Steve Setting up and Configuration of Excel 1 January 13th 05 02:04 AM
runtime error ....object required mlm Excel Programming 3 February 18th 04 06:09 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 04:02 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"