Thread: BIFF8 reader
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default BIFF8 reader

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