PC Review


Reply
Thread Tools Rate Thread

Adding custom property to Range object

 
 
Morgan
Guest
Posts: n/a
 
      27th Apr 2007
Hi all,

We have a need to attach some information to some cells in a worksheet
programmatically. We do not want user to see or be able to change/remove
attached information. We are currently using ID property, but it has some
draw backs, e.g. not persisted when saving the Excel file, can be moidfied
when data validation is used. I am wondering whether there is a way to add
custom property to the Range object so we can use that to store the
information.

Thanks in advance,

Morgan Cheng
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      27th Apr 2007
You could add a worksheet name like so

rng.Parent.Names.Add _
Name:=rng.Parent.Name & "!Add_" & rng.Address(False, False), _
RefersTo:="myCustomProp"

and read it like so

MsgBox Evaluate(rng.Parent.Names(rng.Parent.Name & "!Add_" &
rng.Address(False, False)) _
.RefersTo)


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Morgan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> We have a need to attach some information to some cells in a worksheet
> programmatically. We do not want user to see or be able to change/remove
> attached information. We are currently using ID property, but it has some
> draw backs, e.g. not persisted when saving the Excel file, can be moidfied
> when data validation is used. I am wondering whether there is a way to add
> custom property to the Range object so we can use that to store the
> information.
>
> Thanks in advance,
>
> Morgan Cheng



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Property of the Range Object =?Utf-8?B?R2FyeScncyBTdHVkZW50?= Microsoft Excel Programming 3 25th Sep 2007 01:16 AM
workflow: custom object instance as a parameter or property in custom activity Bandu Microsoft Dot NET Framework 0 2nd Sep 2007 07:41 PM
workflow: custom object instance as a parameter or property in custom activity Bandu Microsoft C# .NET 0 1st Sep 2007 07:16 PM
range property of range object Woody Microsoft Excel Programming 1 23rd Jun 2005 09:04 PM
How to use Cells property to Range object? deko Microsoft Excel Programming 3 8th Mar 2005 06:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.