On 07/24/2013 08:44 AM, MB Software Solutions, LLC wrote:
On 7/24/2013 11:03 AM, Alan Bourke wrote:


On Wed, Jul 24, 2013, at 03:21 PM, Stephen Russell wrote:


Why not use ADO and query the excel file as a data object from now on?
This was as Office365 or any other new version comes out. You are safe.

+1 for this - the Office Connectivity Components. Just work directly
with XLSX, much easier.


An older ProFox post with Alan's code:
--------------------------------
Subject: Re: Excel Data Import into VFP w/Multiple Pages
Date: Fri, 26 Apr 2013 16:52:15 +0100
From: Alan Bourke <[email protected]>
Reply-To: ProFox Email List <[email protected]>
To: [email protected]

The way I tend to do this these days is the Office Data Connectivity
Components (free Microsoft component). Handles all types of Excel files
via OLE DB:

        This.SQLHandle = SqlStringConnect("Driver={Microsoft
        Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};" ;
                            +"DBQ=" +
                            FullPath(lcFile)+";")

... where lcFile is your Excel workbook. then:

            lcSelect=[SELECT
            Date,Account,Name,Ref1,Value,Lodgement FROM
            "Sheet1$"]
            lnResult = SQLEXEC(This.SQLHandle, lcSelect,
            "_stage1_")

That gets you a cursor called '_stage1_' with the contents of Sheet 1 in
the workbook.

Don't really see any easier options to be honest.

--------------------------------
Okay, I redid my getxls() and named it getxlsx(). One note is that "Sheet1$" above is the name of the first sheet. If it is different you need to rename the sheet in the spreadsheet or rename the variable above.
Thanks for your help!

Jeff

---------------

Jeff Johnson
[email protected]
(623) 582-0323

www.san-dc.com
www.arelationshipmanager.com





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to