Link to home
Start Free TrialLog in
Avatar of randpinc
randpincFlag for United States of America

asked on

convert/ import XLSB / vfp9

Is there a utility to convert xlsb format to csv?  

Alternatively, is there library function that would let a VFP9 application read a XLSB format spreadsheet?

Thanks
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

The recommended utility is Microsoft Excel.  You may use Office 365 suite which costs a few $$ monthly and convert whatever you need.

The way of doing it via FoxPro is more difficult and it will require certain programming skills...

Your options in Visual FoxPro are following:
1) ODBC driver
- download and install Access database engine (32 bit!) and use this code to read the XLSB file.
- you may also connect the XLSB file directly via SQLCONNECT() function and read it via SQLEXEC()

2) OLE Automation
- Open the locally installed Excel by CREATEOBJECT("Excel.Application")
- Open the workbook and read it cell by cell.
- More info: http://fox.wikis.com/wc.dll?Wiki~ExcelAutomation

To export FoxPro database table to CSV file is easy:
COPY TO SomeFile TYPE CSV
Avatar of randpinc

ASKER

Thanks,

We need our VFP application to be able to read data from a XLSB spreadsheet into a cursor, and then process it.  

I think we will explore the ODBC options, and see if either of those gets us where we need to be.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks
Avatar of jrbbldr
jrbbldr

If you are not familiar with VFP Automation of Office/Excel, then I might suggest that you look at:
      Microsoft Office Automation with Visual FoxPro

Another BIG assist in learning what Automation steps need to be done is to first do what you want to do in Excel (alone with no VFP involved) while recording your actions as a Macro.
Then you can review/edit the Macro and find out what Excel did - then work that into your VFP Automation code.

Good Luck