Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Syntax from VFP8
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00917279
Message ID:
00917290
Vues:
20
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
Fil
Voir

Click here to load this message in the networking platform