I am developing a tool to make a revision documents using excel VBA , I import excel files into our tool and manipulate them and export them , and for the second revision we import the old document and manipulate them and create a new document. So i want to add some kind of identification to the documents created by our tool , so that next time the program will identify as a previous document created with this tool.

Is there is any way to add something to excel file like excel signature and read them next time with vba? I dont want to write anything inside the cells in the workbook.

Any idea?.

有帮助吗?

解决方案

You could change the Author of the document?

Sub ChangeAuthor()
ActiveWorkbook.BuiltinDocumentProperties("Author").Value = "ExcelProductionMacro"
End Sub

and to retrieve

Public Function GetAuthor() As String    
GetAuthor = ActiveWorkbook.BuiltinDocumentProperties("Author").Value   
End Function

In case you are interested, here is a complete list of document properties you can access.

Others may be useful, such as Last Author, Category, Comments

BuiltInDocumentProperties

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top