Hi Folks,
I am running with a problem.
I have been retrieving values from a database and printing them in an excel file. I have sucessfully opened the file and i try to print values into it but when i try coming out of it i get any error message that reads like either the eof or bof has been encountered or the current field has been deleted. Even After Many debugs i fail to come out of it.
I dont know how to move further.
I show u the codes please help me debug it..............
Thanks........
'----------------------------------------------------------------------
rsAgent.Open "Select Count(Disp_Id) From AgentDispoDetail Where WorkGroup_Id = 10 and CallStartDt Between '" & Day(login_dt) & "' And '" & Day(logend_dt) & "'", conConnection, adOpenDynamic, adLockReadOnly, adCmdText
' MsgBox "rsAgent Opened Successfully"
' MsgBox login_dt
' MsgBox logend_dt
' rsAgent.MoveFirst
' While Not rsAgent.EOF
' If rsAgent.EOF = True Then
' End
' Else
' rsAgent.MoveFirst
Do While Not rsAgent.EOF
For Row = 3 To rsAgent.RecordCount + 3 Step 1
MsgBox Row
On Error Resume Next
wksheet.Cells(Row + 1, col + 5) = rsAgent.Fields(0)
tmp = rsAgent.Fields(0)
total = total + tmp
MsgBox total
rsAgent.MoveNext
Next Row
Loop
rsAgent.Close
wksheet.Cells(Row, col + 5) = total
MsgBox " I am Closing The File"
' dt = Now
'-------------------------------------------------
' Close The Workbook After Saving It.
'-------------------------------------------------
appExcel.ActiveWorkbook.SaveAs "C:\bgb\version1\Camp_Biz.xls"
appExcel.ActiveWorkbook.Save
' Close Excel Application Completely.
appExcel.Quit
Set appExcel = Nothing