Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Syntax from VFP8
Message
From
25/06/2004 18:20:11
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00917279
Message ID:
00917427
Views:
14
Hi Joe
The Excel Macro recorder is a great tool
I recorded a macro to define a name on a sheet called "Cashflow" and it shows
ActiveWorkbook.Names.Add Name:="myname", RefersToR1C1:="=Cashflow!R2C1"
you would amend that to read
oexcel.ActiveWorkbook.Names.Add Name:="myname", RefersToR1C1:="=Cashflow!R2C1"
regards
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform