Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ole with excel
Message
 
To
23/09/2004 07:11:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00945305
Message ID:
00945310
Views:
25
You can use ShellExecute API:
LOCAL result
IF .NOT. EMPTY(thisform.txtExcelFile.Value) .AND. FILE(ALLTRIM(thisform.txtExcelFile.Value))
   DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;
                                               STRING cOperation,;
                                               STRING cFileName,;
                                               STRING cParameters,;
                                               STRING cDirectory,;
                                               INTEGER nShowWindow
    result = ShellExecute(0, 'Open', ALLTRIM(thisform.txtExcelFile.Value) , '', '', 1)
    DO CASE
       CASE result ==  0         && The system is out of memory or resources.
            msg = "There is  not enought memory to complete the operation"
       CASE result ==  2         && Bad Association (for example, invalid URL)
            msg = "Invalid path or file name"
       CASE result == 29         && Failure to load application
            msg = "Error during loading the application"
       CASE result == 30         && Application is busy 
            msg = "The application is busy"
       CASE result == 31         && No application association
            msg = "No application is associate to the " + JUSTEXT(ALLTRIM(KadView.cPicture))+" file type"
   ENDCASE
   IF INLIST(result, 0, 2, 29, 30, 31)
      GetMessage(msg, 0 + 64, "Document view")
   ENDIF
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform