Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Import from Excel
Message
From
15/07/2004 16:07:49
 
 
To
13/07/2004 02:44:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00918198
Message ID:
00924894
Views:
24
Ok - here it is
oform=creat('my_form')
oform.show

DEFINE CLASS my_form AS FORM
	import_file_name=''
    caption=[Mohammed's form]
    
	ADD object mybutton1 as mybutton
	
	
    
	PROCEDURE import_file
	LOCAL jline
	THISFORM.import_file_name=GETFILE('XLS','TEST')
    
    
    IF !FILE(thisform.import_file_name)
       =MESSAGEBOX('The file does not exist...',16,'System Message')
       return(.f.)
    ENDIF

    IF FILE(JUSTSTEM((thisform.import_file_name))+ '.dbf')
       jmess=MESSAGEBOX('Warning, the file already exists...'+ CHR(13)+ CHR(13)+ 'Overwrite?',36,'Question')
       IF jmess=6  && ok
       else
         return(.f.)
       endif
    ENDIF

    
    IF .not. '.XLS' $ UPPER(thisform.import_file_name)
       =MESSAGEBOX('The file is not an excel file...',16,'System Message')
       return(.f.)
    ENDIF
    
    
*-- test for file etc...
*-- if everything fine there

	jline='import from '+ THISFORM.import_file_name+ ' type xl5'
	&jline

    BROWSE
    

	ENDPROC
ENDDEFINE


DEFINE class mybutton as commandbutton
	Caption="Import File"
	Default=.T.
	top=1
	left=1
	PROCEDURE click
	dodefault()
	thisform.import_file()

ENDDEFINE 
>hello,
>
>thank you,
>
>but still i need full example if you can.
>
>i read your code but i dont know were i can use it.and how.
>
>thanks.
Thanks,

Stacy



Black Mountain Software, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform