Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

builtdocumentproperties=value in a cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mhoffmeier - 31 Jan 2006 20:26 GMT
I'm new to this programming thing, and am making a simple mistake I'm
sure.  I'd like to set a document property to equal a cell's value,
that cell is named "total".  What is wrong with the following?  It sets
the comments value to the word total, not the numeric value in the cell
named "value".  Also,how would I get it to run automaticaly on save?
The goal here is to be able to see the totals in estimates before
opening them.

Sub total()
ThisWorkbook.BuiltinDocumentProperties("comments").VALUE = total

End Sub

The properties it sets show up in excel under the file/properties
dialog box when the file is open, but don't show up in windows until I
close the file.  Not a big deal, but it seems odd that they don't
update when the file is saved.
Tom Ogilvy - 31 Jan 2006 21:59 GMT
In the ThisWorkbook.Module

Private Sub Workbook_BeforeSave( _
  ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.BuiltinDocumentProperties( _
  "comments").VALUE = ThisWorkbook.Names("total") _
   RefersToRange.Value
End Sub

You can also just use

Range("Total").Value   I would think.

Signature

Regards,
Tom Ogilvy

> I'm new to this programming thing, and am making a simple mistake I'm
> sure.  I'd like to set a document property to equal a cell's value,
[quoted text clipped - 13 lines]
> close the file.  Not a big deal, but it seems odd that they don't
> update when the file is saved.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.