View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg Lovern Greg Lovern is offline
external usenet poster
 
Posts: 224
Default The name ... either conflicts with a valid range reference or isinvalid for Excel.


Now another user has reported this error, though with a different
button number.

Any suggestions? I still haven't been able to repro.

Greg



On Jan 25, 8:58 am, Greg Lovern wrote:
One of my users is getting the following error. He sent me a picture
so I have the exact text:

================================================== ========
[Microsoft Office Excel]
(exclamation point)
The name, ClickedMatchButton("Button 664"), either conflicts with a
valid range reference or is invalid for Excel. The name has been
replaced with _1ClickedMatchButton__Button_664.

You may still need to manually update any references to this name used
in VBA code or as text arguments in functions. You must close and
reopen the workbook before these changes take effect.

<OK <OK to All
================================================== ========

(btw the "1" is there in the error message; it's not a typo.)

We're both using Excel 2007.

The code is NOT creating defined names. The code is creating forms
(not ActiveX) buttons, and setting their OnAction properties to send
their own button name as a parameter to a function:

strButtonNameArg = """" & btnMatch.Name & """" 'must wrap with
doublequote characters.
btnMatch.OnAction = "'" & strThisWorkbookName &
"'!'ClickedMatchButton(" & strButtonNameArg & ")'"

(the reason I'm doing it that way is because we have too many long
parameters for OnAction's 255-character limit, so I'm putting the real
parameters in the buttons' AlternativeText properties, which have a
4,095-character limit (in VBA, though only 255 manually), then parsing
the parameters out of each button's AlternativeText property when
called, using commas as delimiters and doubling any commas in the
actual parameters to escape them.)

It all works fine for me, and fine for others except for the one
person, and fine him too most of the time. He's gotten the error twice
(with different button numbers each time).

I don't see any reference to this error in this newsgroup. I found
three on the web, but two of them have no solutions, and the third is
in Thai, which unfortunately Babelfish doesn't translate to English:

http://www.fftodayforums.com/forum/i...t=1520&p=10526

I haven't been able to reproduce this error myself, though I've done
exactly what that user said he'd done, with the exact same input data.
We're both using Excel 2007, and both on Windows XP/SP2.

Any suggestions?

Thanks,

Greg