Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Mike Timpe
  Where is Mike Timpe?
 Vicksburg
 Michigan - United States
 Mike Timpe
 Tags
Subject: RE: Excel Automation
Thread ID: 331535 Message ID: 331543 # Views: 60 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Saturday, December 31, 2011 1:27:41 AM         
   


> I'm working on a VFP 9.0 project to import from Excel spreadsheets of various versions. Each spreadsheet is spec'ed to have headers, but user being users ...
>
> I have working code to use the Excel driver to create a Remote view.
> lcConnstr = [Driver=] + ;
> [{Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};] + ;
> [DBQ=] + lcXLBook + [;FirstRowHasNames=Yes]
>
> lnSQLHand = SQLSTRINGCONNECT( lcConnstr )
>
> When the worksheet contains a header, all is fine. However, when the header is absent and the data records begin in Row 'A', I lose the first data record. I'm already creating an Excel object to be able to determine the number of worksheets in the file as well as the user defined names of each sheet. I've viewed the created object in the debugger, but none of the properties Jump out at me
> screaming that a header is present or not present.
>
> Any ideas?
>
> Mike

There's a parameter both for the Excel ODBC and the ADODB.Connection object's connection string to signal has or has no column header row.
See www.connectionstrings.com for examples or Microsoft's documentation.
-Anders

ENTIRE THREAD

Excel Automation Posted by Mike Timpe @ 12/30/2011 9:15:20 PM
RE: Excel Automation Posted by Anders Altberg @ 12/31/2011 1:27:41 AM
RE: Excel Automation Posted by Mike Timpe @ 1/3/2012 2:14:08 PM
RE: Excel Automation Posted by Borislav Borissov @ 1/3/2012 2:47:25 PM
RE: Excel Automation Posted by Cetin Basoz @ 1/3/2012 7:33:24 PM
RE: Excel Automation Posted by Mike Timpe @ 1/3/2012 7:50:52 PM