LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default "That name is not valid"

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table "Data source reference is not valid" error cause? Bill Neurohr Excel Discussion (Misc queries) 1 March 11th 09 10:16 PM
Formula to confirm entry in Col "C" is valid for data in Col "A" VAPCMD Excel Discussion (Misc queries) 2 January 2nd 09 07:58 PM
=IF(VLOOKUP(C11,Group,2,FALSE)=D11,"True","Not Valid") and =IF(D1 Milky Excel Worksheet Functions 1 August 20th 08 08:38 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"Activeworkbook" function not valid when workbook embedded in Lotus Notes? Punsterr Excel Programming 0 May 10th 06 11:37 PM


All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"