excel file properties question

G

Gary Keramidas

i usually right click on an excel file in explorer and enter a revision number
on the advanced properties page. this number shows on the statistics tab under
file/properties in excel.

is it possible to extract this number with code?
is it possible to set this number with code?
 
G

Guest

Hi,

Try this

Sub revision_number()
RevNo = ThisWorkbook.BuiltinDocumentProperties("Revision Number")
MsgBox RevNo
ThisWorkbook.BuiltinDocumentProperties("Revision Number") = _
ThisWorkbook.BuiltinDocumentProperties("Revision Number") + 1
RevNo = ThisWorkbook.BuiltinDocumentProperties("Revision Number")
MsgBox RevNo
End Sub


Mike
 
F

Frederik

According to the Help in Excel VBA the BuiltinDocumentProperties are
ReadOnly...
So you can't change them...
 
P

Peter T

I don't think help is right about that, for me I can Write, eg

wb.BuiltinDocumentProperties("Revision Number") = "4"

If the file is closed can use the DSOfile.dll, assuming the dll is
registered -

Dim dso As DSOFile.OleDocumentProperties
Set dso = New DSOFile.OleDocumentProperties

dso.Open sfilename:=strFullName ' , ReadOnly:=False
sValue = dso.SummaryProperties.RevisionNumber
dso.Close

..RevisionNumber is indeed ReadOnly, adding ReadOnly:=False above doesn't
help.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top