Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel
Message
De
27/12/2000 13:31:28
 
 
À
27/12/2000 13:19:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Excel
Divers
Thread ID:
00457034
Message ID:
00457040
Vues:
21
>What would be the procedure code to open an excel file in a VFP6.0 .prg?
>
>Say the file name I want to open is "c:\temp.xls"


You could do it one of two ways:
1) Use automation. e.g., in Excel 2000 (maybe 98 as well)
oExcel = CreateObject("Excel.Application")
oExcel.Workbooks.Open("c:\temp.xls")
oExcel.Visible = .T.
2) Use the ShellExecute API
Declare Integer ShellExecute ;
    In shell32.dll ;
    Integer nWinHandle, ;
    String cOperation, ;
    String cFileName, ;
    String cParameters, ;
    String cDirectory, ;
    Integer nShowWindow

Declare Integer FindWindow ;
   In win32api ;
   String cNull, String cWinName

ShellExecute(FindWindow(0, _screen.Caption), ;
                    "Open", "c:\temp.xls", ;
                    "", Sys(2023), 1)
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform