Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel
Message
From
27/12/2000 13:31:28
 
 
To
27/12/2000 13:19:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Excel
Miscellaneous
Thread ID:
00457034
Message ID:
00457040
Views:
20
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform