Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel, checking to see if a range name exists
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00930432
Message ID:
00930536
Views:
13
**This seem to let me use an range name that's on sheet1 on sheet2.
** then when I look in excel the ranges names for each sheet are differntiated like this

** name sheetX
** LastDay Sheet1!
** LastDay Sheet2!

mySheetIs = alltrim(oExcel.ActiveSheet.name)
.range(myOwnRange).name = MyOwnName && give this cell this name
nam = ALLTRIM(oexcel.range(MyOwnRange).name.name) && what name to a variable
IF .not. "!"$nam
nam = mySheetIs + "!" + nam && this lets you use the same name again as far as I can see
endif
ref = oexcel.range(MyOwnRange).name.RefersToR1C1 && get the r1c1 reference
oexcel.Names.add(nam, ref) && make sure the range name is added won't make copies
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform