Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How does Excel enumerate the Names collection?
We're getting spreadsheets from overseas offices with named ranges that we cannot access by name, nor delete, rename or hide... Not even when I enumerate the names collection, or loop though it by ordinal number: For each MyName in Thisworkbook.Names MyName.delete Next MyName or the alternative: For i = Thisworkbook.Names.Count to 1 Step - 1 Thisworkbook.Names(i).Delete Next i As soon as either loop hits the offending item in the collection, VBA raises the error "That name is not valid". Inspecting the names collection using the 'Insert; Names...' dialog from the worksheet menubar reveals that the name contains non-standard characters which display as odd squiggles and squares on a UK- or US-locale PC. Possibly they are umlauts, accented vowels, or copied from Cyrillic documents. Changing the locale to Sweden, Germany or Japan doesn't help. (Japan was a wild guess - we know it's the wrong language, but the codepage is so large that surely there's no such thing as an invalid character...). All suggestions welcome* Also... Some idea of how Excel actually stores that collection would be interesting. Surely it's got some kind of internal ordinal; I can't believe that it's indexed by hashing the unicode string from the name. * The suggection 'Nuke the site from orbit' has been carefully considered but was found to be impracticable for reasons of health & safety. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Table "Data source reference is not valid" error cause? | Excel Discussion (Misc queries) | |||
Formula to confirm entry in Col "C" is valid for data in Col "A" | Excel Discussion (Misc queries) | |||
=IF(VLOOKUP(C11,Group,2,FALSE)=D11,"True","Not Valid") and =IF(D1 | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"Activeworkbook" function not valid when workbook embedded in Lotus Notes? | Excel Programming |