Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DBF to fomatted xls spreadsheet
Message
 
À
04/08/2003 12:34:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00816537
Message ID:
00816954
Vues:
31
>To whom it may concern:
>
>I would like some input on how to copy data to an already formatted excel spreadsheet. This is something for very new to me. So if any has any ideas please email me back. Thanks in advance.
>
>Kimberly

Kimberly,

I believe that the most suitable method here is to use Excel automation to pull external data into Excel, like:

ObjExcel= getOBJECT(,"Excel.Application")
ConnectionString="ODBC;DSN=Visual FoxPro Tables;UID=;PWD=;SourceDB=c:\foxwork\vfpapps;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;"

sqlquery="SELECT msprod from msconst"

xlOverwriteCells=0
with ObjExcel.ActiveSheet.QueryTables.Add(;
ConnectionString,;
ObjExcel.ActiveSheet.Range("B6"),;
sqlquery)
.FieldNames = .f.
.RefreshStyle = xlOverwriteCells
.RowNumbers = .f.
.FillAdjacentFormulas = .f.
.HasAutoFormat = .f.
&& other options may go here to preserve formattings; record a macro in Excel to see details

.Refresh

endwith
......
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform