PC Review


Reply
Thread Tools Rate Thread

BIFF8 reader

 
 
RB Smissaert
Guest
Posts: n/a
 
      25th Apr 2007
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
 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      26th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      26th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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

>
>


 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      26th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> >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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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

> >
> >

>



 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      26th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>> >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" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> 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
>> >
>> >

>>

>
>


 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      26th Apr 2007
Examining this reader code along with the code for those BIFF writers, may
give you some insight in where the errors lay.
I'll have a look over the next few days, but don't hold your breath on any
useful additions.

NickHK

"RB Smissaert" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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" <(E-Mail Removed)> wrote in message
> >> news:%(E-Mail Removed)...
> >> >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" <(E-Mail Removed)> wrote in message
> >> > news:(E-Mail Removed)...
> >> >> 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
> >> >
> >> >
> >>

> >
> >

>



 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      26th Apr 2007
Yes, I have some very nice looking code to write to BIFF and looking at that
may help.
Main trouble is not understanding the BIFF format.
Thanks in any case for your efforts and I won't hold my breath.
Will report back here when I have some progress with this.

RBS

"NickHK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Examining this reader code along with the code for those BIFF writers, may
> give you some insight in where the errors lay.
> I'll have a look over the next few days, but don't hold your breath on any
> useful additions.
>
> NickHK
>
> "RB Smissaert" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> 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" <(E-Mail Removed)> wrote in message
>> >> news:%(E-Mail Removed)...
>> >> >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" <(E-Mail Removed)> wrote in message
>> >> > news:(E-Mail Removed)...
>> >> >> 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
>> >> >
>> >> >
>> >>
>> >
>> >

>>

>
>


 
Reply With Quote
 
bart.smissaert@gmail.com
Guest
Posts: n/a
 
      27th Apr 2007
There is a BIFF reader and writer here with Delphi source code that
might be of help:

http://delphi.icm.edu.pl/newl/midxd70f.htm

RBS

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BIFF8 Excel Reader Joel Leong Microsoft Dot NET Framework 0 24th Mar 2005 01:34 AM
BIFF8 Excel Reader Joel Leong Microsoft Dot NET Framework 1 23rd Mar 2005 03:27 PM
Biff8 format documentation Basil Microsoft Excel Programming 2 7th Jul 2004 01:45 PM
The Biff8 and Ole2 formats Basil Microsoft Excel Programming 1 7th Jul 2004 05:19 AM
BIFF8 Sample ABC - Sébastien Beaugrand Microsoft Excel Programming 8 27th Apr 2004 06:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:27 AM.