Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel OLE Automation Server
Message
De
15/12/1999 01:17:17
 
 
À
13/12/1999 07:07:31
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00302601
Message ID:
00303911
Vues:
29
Hi All,
How can I insert the following code

oLineGraph = CreateObject('Excel.Sheet')
If !File('EachLine.XLS')
MessageBox('File EACHLINE.XLS is not found!',16)
Return
EndIf
ThisForm.oLineGraph.WorkBooks.Open('EachLine.XLS')

into the Load_XL Procedure, after locate the *.xls file.

Please give some advice.

Thanks

Dennis

PROCEDURE Load_XL

LPARAMETER ta_files

EXTERNAL ARRAY ta_files
DIMENSION ta_files[1]
ta_files = ""
LOCAL loDirTree, a_dir, lcskel, lcdrive,;
lni, lnlast, lcpath, a_files, lnj, lnfiles,;
lnoffset
SET PROCEDURE TO Dir_Tree ADDITIVE
set oleobject off
* C:\ is the default start path
loDirTree = CREATEOBJECT('Dir_Tree')
RELEASE PROCEDURE Dir_Tree
DIMENSION a_dir[1]
loDirTree.LoadTree(@a_dir)
lcdrive = "C:\"
lcskel = "*.XLS"
lnlast = ALEN(a_dir, 1)
FOR lni = 1 TO lnlast
lcpath = lcdrive + ADDBS(a_dir[lni, 1])
DIMENSION a_files[1]
a_files = ""
lnfiles = ADIR(a_files, lcpath + lcskel)
IF lnfiles > 0
IF EMPTY(ta_files[1])
lnoffset = 0
ELSE
lnoffset = ALEN(ta_files, 1)
ENDIF
DIMENSION ta_files[lnoffset + lnfiles]
FOR lnj = 1 TO lnfiles
ta_files[lnoffset + lnj] = lcpath + a_files[lnj, 1]
{INSERT THE CODING IN HERE, YES OR NO ? }
NEXT
ENDIF
NEXT
loDirTree = NULL
RETURN
ENDPROC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform