Deafbug,
My copy of the etc-1-0-12-1.dll file was in my C:\WINDOWS\System32 directory. The file is only 93kb so it could be downloaded (from Crystal) or sent to you easy enough.
I found the problem!! As I said this report is generated from Crystal Reports and exported. The export was causing merged cells in the footer of the report that spanned more than one line. Once I changed the footer to ensure each bit of text went out on one line in Excel, everything worked...
To answer two earlier questions, I don't know how many records will be in the input sheet, so I can't use a counter.
The ADO Error that is reported is the same
"-2147467259: [Microsoft][ODBC Excel Driver] Unknown, Microsoft OLEDB Provider for ODBC Drivers - 22005
Here is the function that connects to the excel sheet
Public Function ConnectExcel(pcConnection As ADODB.connection, FilePath As String) As Boolean
Dim strConnection As String
On Error GoTo ADOErrors
ConnectExcel = False
strConnection = "Driver={Microsoft Excel Driver...
I have cut off the last few records in the file, so the new last record is one that previously worked before. Therefore I am sure the data is not to blame.
So as the MoveNext is fired after the last row (which should move the pointer to EOF) I get the error. But here is last few records of data...
Dim rs As ADODB.Recordset
sql = "SELECT * from [Sheet1$] Where CountType IN ( 'System', 'Member:', 'Package') "
'creates excel recordset
Set rs = CreateExcelRS(sql, mcConnection, adOpenDynamic)
If rs Is Nothing Then Exit Function
rs.MoveFirst
Dim i As Long
Do Until rs.EOF...
I am sorry. I think I misunderstood your previous post. I thought you were suggesting having someone do a cut and paste as a work around.
The error isn't data related. I am sure of that. I have cut the file in half and it is always the last record, regardless of what data represents that last...
The application is for end users, so dealing with source data is out of the question. I hav even trying doing a recordcount, but the RecordCount Property returns -1 and if I try to loop through, the same error occurs.
I also get the error if I try to use the MoveLast method. It must have something to do with the excel file itself, but I am not sure what to check for
Andrew
The problem with trapping that code is that is an unknown or at least non-specific code. I don't want to get half way through the file, have something happen and then assume I am at the end of the file. I need to ensure all records are processed, or abort the process.
The error code I get back...
I am getting an unknown excel error on the last record of an ADO Excel recordset being called from VB6. The code loops through the records, but on the last record the MoveNext method of the recordset causes this unknown error. It almost seems like the recordset is at the end but rs.EOF is false...
If you are using Instances of forms, remember to set the instance = Nothing when you are finished with it. If not the memory won't be released. This is especially true if your forms are using classes. But if you aren't using instances, make sure the forms are unloaded when you are finished...
I just had to add the three dll's (cxlibw-1-6.dll, dbghelp.dll and etc-1-0-12-1.dll) to the Package and Deployment Wizard that I used to create the install package. I didn't have to use the merge modules at all. The only thing I did was unistall the old app and then reinstall the new version. I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.