Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why this code crash Excel?
When I try to exit this program, the excel crashed.
Here is the code: Public Sub GetLastInfo(sql$, isPre As Boolean, ByRef averCoupon, ByRef HistCls As ClsPreLoss) Dim m_adRst As New ADODB.Recordset Set m_adRst = New ADODB.Recordset On Error GoTo ERROR_HANDLER If m_micADOConn Is Nothing Then ConnectMICDB m_adRst.Open sql, m_micADOConn, ADODB.adOpenForwardOnly, ADODB.adLockReadOnly Dim averCoupon2 As Double If isPre Then HistCls.Pre_Bal = m_adRst.Fields("cBal") HistCls.interest = m_adRst.Fields("nextInterest") averCoupon = m_adRst.Fields("AverCoupon") Else HistCls.cBal = m_adRst.Fields("cBal") HistCls.sBal = m_adRst.Fields("totalSched") averCoupon2 = m_adRst.Fields("AverCoupon") HistCls.averCoupon = (averCoupon + averCoupon2) / 2 End If m_adRst.Close Exit Sub ERROR_HANDLER: MsgBox "GetLastInfo failed: " & Err.Description End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
this code makes excel crash | Excel Programming | |||
Adding code to control on form causes Excel to crash | Excel Programming | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
Problem with code causing Excel '97 to crash | Excel Programming | |||
Excel crash error code | Excel Programming |