Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import Data from Excel97
Message
De
24/09/1999 10:54:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/09/1999 06:36:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00267901
Message ID:
00268512
Vues:
26
>Thank You Basoz for help me. I'll try it. You said this syntax use in visual fox 6. May i use it in VFP5.
>
>Thanks
>Nafees


No you can't. VFP5 doesn't support XL8 but XL5. Then you should perform a workaround :
oExcel = createobject("Excel.Application")
lcXLSName = "c:\mypath\book1.xls"
lcNewName = "c:\temp\myExcel.xls"
lcSheetName = "Sheet2"
#DEFINE xlExcel5  39
WITH oExcel
  .Workbooks.OPen(lcXLSName)
  WITH .ActiveWorkbook
    IF .Sheets.Count > 1
      .Sheets(lcSheetName).Move(.Sheets(1)) && Move before
    ENDIF
    .SaveAs(lcNewName,xlExcel5)
  ENDWITH
  .quit
ENDWITH
Release oExcel
lcNewName = "c:\temp\myExcel.xls"
IMPORT from ( lcNewName ) ;
  database "testdata" ;
  name "mytest" ;
  type XL5
erase (lcNewName)
Sheet ordering is a workaround for import command. It ignores SheetName if database..name is used (or I don't know how to use it correctly).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform