Information générale
Catégorie:
COM/DCOM et OLE Automation
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement