Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Excel, check to see if a range name exists?
I am trying to find out if a range name exists before creating one in excel. I can get
a list of all range names with step 2. However, if I first create a new range name oRange,
as in step 1, the process in step 2 will not find this name. and after I run step 2, the new
range name oRange is gone. how can I check to see if a range name has already been used.
Thanks
Steve
** step 1
oEx = GETOBJECT(,'excel.application')
oRange = "asdf"
ThisNewName = orange
oRange = oEx.Range("a1")
WAIT WINDOW oRange.value && shows .7036
*** step 2
FOR i = 1 TO o.Names.Count
thisOne = ALLTRIM(LOWER(oEx.Names[i].name ))
IF thisNewName$thisOne
? oEx.Names[i].name
endif
ENDFOR
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