Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Copying from one worksheet to another with VFP
Hi All,
I have 2 excel files and I need to copy some of the contents from the first to the second using code in my VFP application.
For some reason when I run it I receive error messages such as "Invalid Index" or "Call was rejected by the callee".
Could any one help?
The code I used was:
oexcel = CREATEOBJECT("Excel.Application")
thefile = FULLPATH('file1.xls')
oexcel.workbooks.OPEN(thefile)
thefile = ALLT('file2.xls')
oexcel.workbooks.OPEN(thefile)
oexcel.worksheets("file1").RANGE("A1:B100").COPY(oexcel.worksheets("file2").RANGE("B1:C100"))
Here I got stuck. It simply refused to do the job with all kind of (the above-mentioned) excuses.
Thanks in advance,
Jonathan
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