Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default DocumentPrperties Collection

Excel 97
I found the following procedure in Help:
Sub AddCustomProperty(dp As DocumentProperties)
' This example adds a new custom document property and names it "Complete".
You must pass the custom _
DocumentProperties collection to the procedure.
dp.Add Name:="Complete", LinkToContent:=False, _
Type:=msoPropertyTypeBoolean, Value:=False
End Sub
I use Dim dp As DocumentProperties
then call the sub via AddCustomProperty dp
and it errors saying "Object variable or With block variable not set."
Various combinations of "Set dp = ..." result in various errors.
--
Trent Argante
[DC.J(166)]
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default DocumentPrperties Collection

After Dim you need to set the document properties object
Set dp = ThisWorkbook.CustomDocumentProperties

Alok Joshi

"Trent Argante" wrote:

Excel 97
I found the following procedure in Help:
Sub AddCustomProperty(dp As DocumentProperties)
' This example adds a new custom document property and names it "Complete".
You must pass the custom _
DocumentProperties collection to the procedure.
dp.Add Name:="Complete", LinkToContent:=False, _
Type:=msoPropertyTypeBoolean, Value:=False
End Sub
I use Dim dp As DocumentProperties
then call the sub via AddCustomProperty dp
and it errors saying "Object variable or With block variable not set."
Various combinations of "Set dp = ..." result in various errors.
--
Trent Argante
[DC.J(166)]

  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default DocumentPrperties Collection

Hello: Is there a simple way to set the default user data, such as author,
title and company etc for all workbooks saved by me?? Thanks
--
Max from Melbourne


"Alok" wrote:

After Dim you need to set the document properties object
Set dp = ThisWorkbook.CustomDocumentProperties

Alok Joshi

"Trent Argante" wrote:

Excel 97
I found the following procedure in Help:
Sub AddCustomProperty(dp As DocumentProperties)
' This example adds a new custom document property and names it "Complete".
You must pass the custom _
DocumentProperties collection to the procedure.
dp.Add Name:="Complete", LinkToContent:=False, _
Type:=msoPropertyTypeBoolean, Value:=False
End Sub
I use Dim dp As DocumentProperties
then call the sub via AddCustomProperty dp
and it errors saying "Object variable or With block variable not set."
Various combinations of "Set dp = ..." result in various errors.
--
Trent Argante
[DC.J(166)]

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
data collection driller Excel Discussion (Misc queries) 1 October 13th 09 01:04 AM
help with data collection! brandon roland[_2_] New Users to Excel 1 August 8th 07 10:09 PM
Collection Todd Huttenstine Excel Programming 4 December 17th 04 09:41 PM
Collection methods Christopher Benson-Manica Excel Programming 4 December 9th 04 06:22 PM
Collection Variable Todd Huttenstine Excel Programming 4 August 14th 04 05:32 PM


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

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"