LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Refer to customproperty by name?

You can do the same in Excel with CustomDOCUMENTProperties

ActiveWorkbook.CustomDocumentProperties.Add Name:="x", _
LinkToContent:=False, Type:=msoPropertyTypeNumber, Value:=1

MsgBox ActiveWorkbook.CustomDocumentProperties("x").Value ' Type mismatch
MsgBox ActiveWorkbook.CustomDocumentProperties(1).Value ' ok



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Helmut Weber" wrote in message
...
Hi everybody,

is there something wrong with this code
or is something wrong with Excel?

'ActiveSheet.CustomProperties.Add Name:="x", Value:=1 ' ok

MsgBox ActiveSheet.CustomProperties("x").Value ' Type mismatch
MsgBox ActiveSheet.CustomProperties(1).Value ' ok

In Word I can refer to a customdocumentproperty by name.
MsgBox ActiveDocument.CustomDocumentProperties("x").Value ' ok

--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000 (german versions)





 
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
How can I refer to a row Mark F[_2_] New Users to Excel 2 July 7th 11 05:29 PM
How to refer a name in VBA clara Excel Discussion (Misc queries) 4 June 26th 08 12:27 AM
Refer to value strikeuk Excel Discussion (Misc queries) 8 May 17th 06 08:42 AM
refer indirectly to Name Hershmab Excel Worksheet Functions 5 March 24th 06 04:30 PM
refer JE McGimpsey Excel Discussion (Misc queries) 2 November 28th 05 06:55 PM


All times are GMT +1. The time now is 12:15 PM.

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"