Thread: BIFF8 reader
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default BIFF8 reader

I have no particular requirement, but I thought it would be useful to have
this option available. The quoted VB code also kind of looks interesting.
ADO will be fine, but it will be slower than reading as BIFF.

RBS

"NickHK" wrote in message
...
Yes, this certainly looks promising, but would involve a LOT more study on
my part to begin to correct some <any of the errors.
I assume you have looked at ADO and decided it does not fit your
requirements ?

NickHK

"RB Smissaert" wrote in message
...
Thanks for that. I have fixed a few things, but like you I am working a

bit
in the dark as I
don't know the BIFF format. I have the documentation, but I can't say it

is
simple.
The main problem I am stuck with now is that it doesn't pick up the next
cell if that cell
holds an integer value and the previous cell on the same row held an

integer
as well.
It would be nice to fix this as you can then quickly check a workbook
without opening it.
Haven't compared but I think it will be faster as well than using an
Excel4Macro.

RBS


"NickHK" wrote in message
...
I had a look at that and the first problem I found is the reading of the
worksheets; it does not seems stop and reads then more than once

resulting
in a index error trying to add duplicate names to the WS collection.
I don't know enough about the BIFF to say how to correct, but you could
may
be hack a fix by checking for that error in cWorkBook.AddWorkSheet. Or
simply ignore the error until you know the BIFF reason <g.

'Previous routine
Public Sub AddWorkSheet(name)
Dim NewWorkSheet As New cWorkSheet
NewWorkSheet.name = name
m_WorkSheet.Add NewWorkSheet, name
Set NewWorkSheet.Parent = Me
End Sub

'change to
Public Function AddWorkSheet(name) As Boolean
Dim NewWorkSheet As New cWorkSheet

On Error GoTo Handler
NewWorkSheet.name = name
m_WorkSheet.Add NewWorkSheet, name
Set NewWorkSheet.Parent = Me
AddWorkSheet = True
Exit Function

Handler:
Select Case Err.Number
Case 457
AddWorkSheet = False
Case Else
'Decide
End Select

End Function

NickHK

"RB Smissaert" wrote in message
...
Looking for VB code to read an .xls file as BIFF8.
Found code at Planet Source Code:
http://devnull.at/?8QDSY
But is has bugs and not managed yet to fix it.

Would there be anybody on this forum who is willing
to pass VB code (maybe the fixed code from PSC) that
does this?

Have posted to the VB6 group as well, but little reply from there.

RBS