Author's Name

  • Thread starter Thread starter Larry S
  • Start date Start date
L

Larry S

I would like the document to save the Application.UserName as the Author of
the document when the document is saved. So when you check the properties of
the document and go to the Summary tab, the author of the document will be
listed as the Application.UserName.

Thanks,
Larry
 
Try this...

ThisWorkbook.Author = Application.UserName

or maybe this...

ActiveWorkbook.Author = Application.UserName
 
Try ...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.BuiltinDocumentProperties(3) = Application.UserName
End Sub
 
This worked fine for the application i had intended it for, which was to run
it inside a saveas macro that i had previously created. So that issue is
resolved, but to take it one step further how do you achieve the same result
by simply using the excel save or saveas command? The reason i would need to
do this is because unlike saving a workbook that was created locally by
starting excel, the workbooks are templates stored on our server and when you
do a saveas nothing is stored in the author field.
 
I don't have network access so I can't duplicate your set up for testing;
however, to speculate... I'm thinking that nothing gets stored in the author
field because there is nothing in the Application.UserName field (I think
Excel gets this from the General tab on Tools/Options which I'm guessing
your templates don't have filled in either). Maybe you could reach out to
the operating system and do something like this...

ActiveWorkbook.Author = Environ("UserName")
 

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

Similar Threads

Shapes in 2010 1
UserName Property 12
Application.UserName 2
Sub Not Working 6
Unlocking Project When Condition is Met 2
Unique Computer ID 0
SaveAs Question 2
Workbook_Open not working? 4

Back
Top