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: 18
Default CustomDocumentProperties problem...

Hello ng!

I am having some trouble with a CustomDocumentProperty I try to define in an
Excel workbook.
As the code is very simple, here I go.
The first worksheet contains two named ranges, called "testfeld1" (contains
value: "5") and "testfeld2" (contains value: "hello world").

=====================
Private Sub TestCDP()
If ActiveWorkbook.CustomDocumentProperties.Count 0 Then
ActiveWorkbook.CustomDocumentProperties("CDP").Del ete
ActiveWorkbook.CustomDocumentProperties("CDP2").De lete
End If

ActiveWorkbook.CustomDocumentProperties.Add Name:="CDP", _
Type:=msoPropertyTypeNumber, _
LinkToContent:=True, LinkSource:="testfeld"
ActiveWorkbook.CustomDocumentProperties.Add Name:="CDP2", _
Type:=msoPropertyTypeString, _
LinkToContent:=True, LinkSource:="testfeld2"

DisplayPropertyInfo (ActiveWorkbook.CustomDocumentProperties("CDP"))
DisplayPropertyInfo (ActiveWorkbook.CustomDocumentProperties("CDP2"))
End Sub

Sub DisplayPropertyInfo(dp As DocumentProperty)
MsgBox "value = " & dp.Value & Chr(13) & _
"type = " & dp.Type & Chr(13) & _
"name = " & dp.Name
End Sub
=====================

As a result, I get the following values:
CDP = 0
CDP2 = ???????????????????????????????????????????????? ?????????????

However, if I access the CDPs via the menu (File/Properties), I can see the
correct values etc.

Any guess what's wrong?

Thanks a lot!
Jens


 
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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
Adding and Changing 'CustomDocumentProperties' from VBA on other f VBA Dabbler Excel Programming 3 February 2nd 05 03:10 AM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM
CustomDocumentProperties Robert Hind Excel Programming 7 December 21st 03 01:59 PM


All times are GMT +1. The time now is 09:59 AM.

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

About Us

"It's about Microsoft Excel"