Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Office 2007 compatibility issues
Message
From
03/02/2007 09:41:12
 
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01191826
Message ID:
01192101
Views:
35
>>>Aleksey,
>>>
>>>As I now understand, Visual FoxPro doesn't support versions of Excel beyond XL8. like in the new Office 2007.
>>>
>>>Since both Excel and Visual FoxPro are MS products, can we expect a solution in a service pack?! As of this moment I have not a single client who uses Office 2007, but that will most likely change in the course of this year.
>>>
>>>See also: Re: Import from Excel in Office 2007 Thread #1191678 Message #1191724
>>
>>I use excel2007 and vfp9 and the COM works just like before, at least in my applications.
>
>Can you try to IMPORT an XLS file that was generated by Excel2007? I got the impression from what Jim Booth wrote that this will cause a problem.

Peter

here is a very simple quickie. I have a excel2007 file called xxx.xlsx (<--see the last x in the extension) and end up with a cursor called cc1

naturally in real live you would know the type and width of your data field and create teh
SET STEP ON 

cAsc=[ABCDEFGHIJKLMNOPQRSTUVWXYZ] &&& to convert # int letters :-)

#INCLUDE excel10.h	
#define LF CHR(13)+CHR(10)


LOCAL oExcel as Excel.Application && to make intellisense happy
lcFileName=[c:\vapps\vcpr3\temp\xxx.xlsx]

oExcel=CREATEOBJECT("Excel.Application")
oExcel.visible= .T.
oExcel.DisplayAlerts = .F.

oW=oExcel.Workbooks.Open(lcFileName)
* select sheet 3
ow.Worksheets[3].select



nRows	= oExcel.ActiveSheet.UsedRange.Rows.Count
nCols	= oExcel.ActiveSheet.UsedRange.Columns.Count

cLastCol=substr(cAsc,nCols,1) &&& there are more sophisticated ways for wider sheets then A-Z
xx= [create cursor cc1 (]
	
FOR I = 1 TO nCols
	xx = xx + "F"+TRANSFORM(m.i)+" C(50),"
ENDFOR
xx=LEFT(xx,LEN(xx)-1)+[)]
&& create a cursor
&xx 

&& get the range
oRange = oExcel.ActiveSheet.Range("A1:" + cLastCol+TRANSFORM(nRows)  )
* fetch teh data into an array
la1=oRange.value 

SELECT cc1
APPEND FROM ARRAY la1
BROWSE 
Hope this proves the concept at least


Peter
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform