Names.Add Bug

J

Josh Sale

In full Excel, ActiveworkSheet.Names.Add(...) returns a Name object.
According to the OWC11 help files, this method returns a Name object.

However, in practice, if you try to do this, the compiler generates an error
saying "The expression does not produce a value".

Clearly either the help file or the code is in error and if consistency with
Excel is worth anything, its the code that's in error.

Alvin, perhaps you can report this problem to somebody at MS?

TIA,

josh
 
A

Alvin Bruney [Microsoft MVP]

write it up, i'll pass it along. make sure you list what you think is
happening followed by what is actually happening.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc
 
J

Josh Sale

The following statement is legal in Excel (all versions since Excel 97):

Set namedRange = activeSheet.Names.Add(newName, _
Range(xx, yy), _
True, _
3)

According to the OWC11 help file, the above statement should work just fine (less the Set statement if working with VB.Net).

However, in practice with OWC11, the Names.Add method is defined to not return anything (i.e., its a subroutine not a function). It should return an object reference to the newly added Name as Excel does and as promised in the Microsoft supplied help file.

Hope this is clear.

josh






Alvin Bruney said:
write it up, i'll pass it along. make sure you list what you think is
happening followed by what is actually happening.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc
-------------------------------------------------------------------------------


Josh Sale said:
In full Excel, ActiveworkSheet.Names.Add(...) returns a Name object.
According to the OWC11 help files, this method returns a Name object.

However, in practice, if you try to do this, the compiler generates an
error saying "The expression does not produce a value".

Clearly either the help file or the code is in error and if consistency
with Excel is worth anything, its the code that's in error.

Alvin, perhaps you can report this problem to somebody at MS?

TIA,

josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top