Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JAC JAC is offline
external usenet poster
 
Posts: 31
Default Custom Document Properties

Does anyone know how to remove a specified Custom Document Property
from an Excel workbook using VBA?
Adding is easy. There is a method to Add.

I tried to use the Macro Recorder while trying to delete a property
manually, but it did not record anything useful.
Thank you in anticipation.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Custom Document Properties

Hi JAC,

Suppose I already have a custom property named "CustomNumber" in the
workbook object wbk. To erase it just write:

Call wbk.CustomDocumentProperties("CustomNumber").Delet e

Custom Properties work like any other collection. You should take a look to
the help file of the collection object.

--
Carlos


"JAC" wrote:

Does anyone know how to remove a specified Custom Document Property
from an Excel workbook using VBA?
Adding is easy. There is a method to Add.

I tried to use the Macro Recorder while trying to delete a property
manually, but it did not record anything useful.
Thank you in anticipation.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Custom Document Properties

There is also a Delete method. Try something like the following:

Dim DocProps As Office.DocumentProperties
Dim DocProp As Office.DocumentProperty
Set DocProps = ThisWorkbook.CustomDocumentProperties
Set DocProp = DocProps("MyProp") ' Here it is.
Debug.Print DocProp.Value
DocProps.Item("MyProp").Delete ' Now it's gone

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 22 Oct 2008 14:08:26 -0700 (PDT), JAC
wrote:

Does anyone know how to remove a specified Custom Document Property
from an Excel workbook using VBA?
Adding is easy. There is a method to Add.

I tried to use the Macro Recorder while trying to delete a property
manually, but it did not record anything useful.
Thank you in anticipation.

  #4   Report Post  
Posted to microsoft.public.excel.programming
JAC JAC is offline
external usenet poster
 
Posts: 31
Default Custom Document Properties

On 22 Oct, 22:43, Carlos wrote:
Hi JAC,

Suppose I already have a custom property named "CustomNumber" in the
workbook object wbk. To erase it just write:

Call wbk.CustomDocumentProperties("CustomNumber").Delet e

Custom Properties work like any other collection. You should take a look to
the help file of the collection object.

--
Carlos

"JAC" wrote:
Does anyone know how to remove a specified Custom Document Property
from an Excel workbook using VBA?
Adding is easy. There is a method to Add.


I tried to use the Macro Recorder while trying to delete a property
manually, but it did not record anything useful.
Thank you in anticipation.


Thanks guys.

I don't know why I didn't think of that. It's so blindingly obvious
when you think about it.

I hope that others find it useful that the problem has been aired.
Reply
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
dont see custom document properties... Dev Excel Programming 1 November 10th 06 02:42 AM
Custom Document Properties - Last Calculation Date Zani Excel Programming 2 February 22nd 06 10:49 PM
How can I using Excel custom document properties in the header? ecalvo Excel Worksheet Functions 4 November 3rd 05 09:29 PM
Accessing custom document properties in Word? quartz[_2_] Excel Programming 1 January 19th 05 02:27 AM
Accessing custom document properties Tim Haley Excel Programming 2 September 6th 03 02:34 AM


All times are GMT +1. The time now is 12:49 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"