Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime error '424': Object Required | Excel Discussion (Misc queries) | |||
"Microsoft Visual Basic runtime error '424' object required". | Excel Worksheet Functions | |||
MS Office error message, "a required .DLL file, MSO97.DLL ..." | Setting up and Configuration of Excel | |||
runtime error ....object required | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |