Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sent to path
Message
 
To
26/07/2004 06:06:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00927833
Message ID:
00927856
Views:
26
I don't quite understand Your question, but MODI FILE with XLS file will not work. MODIFY FILE will open the excel file but the user can see some strange charchters.
You can change it to:
m.a=thisform.text2.Value
CLOSE all
USE (m.a)
gcDelimName = ALIAS( ) + '.xls'
gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
IF EMPTY(gcDelimFile)  && Esc pressed
   CANCEL
ENDIF
*** Let's see if the file is OPEN
fHnd = FOPEN(gcDelimFile,12)
IF fHnd < 0
   ********** File is Open. You can't copy to it
   ******* Put Messagebox() with error
   CANCEL
ENDIF
FCLOSE(fHnd)
COPY TO (gcDelimFile) xl5  && I prefer XL5 instead of XLS

DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;
                                            STRING cOperation,;
                                            STRING cFileName,;
                                            STRING cParameters,;
                                            STRING cDirectory,;
                                            INTEGER nShowWindow
result = ShellExecute(0, 'Open', gcDelimFile , '', '', 1)
** with the code above You can handle errors returned by ShellExecute

DO CASE
   CASE result ==  0	     && The system is out of memory or resources.
   CASE result ==  2	     && Bad Association (for example, invalid URL)
   CASE result == 29	     && Failure to load application
   CASE result == 30	     && Application is busy 
   CASE result == 31         && No application association
ENDCASE
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