Information générale
Catégorie:
COM/DCOM et OLE Automation
l_cname should not contain parentheses, I believe.
>I am working with VFP8 and Excel 2000 to pass some data and then have a macro in excel distribute the data to different sheets. One of the requirements I am trying to do from VFP is to create a Named Range. The values of the range is based on the number of records in the table. The problem I am having is the proper syntax to create the Name in Excel. Here is my code:
>
>oexcel = CreateObject("Excel.Application")
>oexcel.Workbooks.Open("profile.xls")
>oexcel.Sheets("CRITERIA").Activate
>L_NRECCNT=5
>l_cname="('top5','=CRITERIA!$A20:$L$"+ALLTRIM(STR(L_NRECCNT))+"')"
>oexcel.ActiveWorkbook.Names.Add(&L_CNAME)
>
>I get an error message of "Function name is missing )."
>I have tried different variations of the call "oexcel.ActiveWorkbook.Names.Add(&L_CNAME)" but have not succeeded yet.
>
>Any Ideas??
>
>Thanks.
Précédent
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