Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Last saved by

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Last saved by

You can get the name of the file with

ThisWorkbook.Name 'or
ThisWorkbook.FullName.

You can get the original author of the file with

ThisWorkbook.BuiltInDocumentProperties("Author").V alue

You can get the last-saved-by user with

ThisWorkbook.BuiltInDocumentProperties("Last Author").Value

These two values return the name that is entered as the "User Name" in
the Options dialog box. This is not the user's logon id.

You can get the last save time with

FileDateTime(ThisWorkbook.FullName)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Sat, 29 Nov 2008 09:39:01 -0800, JohnUK
wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Last saved by

Many thanks Chip, but I am not sure how I would enter that into a code so
that it would paste those values into the cells of a worksheet.
John

"Chip Pearson" wrote:

You can get the name of the file with

ThisWorkbook.Name 'or
ThisWorkbook.FullName.

You can get the original author of the file with

ThisWorkbook.BuiltInDocumentProperties("Author").V alue

You can get the last-saved-by user with

ThisWorkbook.BuiltInDocumentProperties("Last Author").Value

These two values return the name that is entered as the "User Name" in
the Options dialog box. This is not the user's logon id.

You can get the last save time with

FileDateTime(ThisWorkbook.FullName)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Sat, 29 Nov 2008 09:39:01 -0800, JohnUK
wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Last saved by

You enter it into a worksheet by making a variable equal to the return value
of the built in properties:

userName = ThisWorkbook.BuiltInDocumentProperties("Author").V alue
ActiveSheet.ActiveCell = userName


"JohnUK" wrote:

Many thanks Chip, but I am not sure how I would enter that into a code so
that it would paste those values into the cells of a worksheet.
John

"Chip Pearson" wrote:

You can get the name of the file with

ThisWorkbook.Name 'or
ThisWorkbook.FullName.

You can get the original author of the file with

ThisWorkbook.BuiltInDocumentProperties("Author").V alue

You can get the last-saved-by user with

ThisWorkbook.BuiltInDocumentProperties("Last Author").Value

These two values return the name that is entered as the "User Name" in
the Options dialog box. This is not the user's logon id.

You can get the last save time with

FileDateTime(ThisWorkbook.FullName)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Sat, 29 Nov 2008 09:39:01 -0800, JohnUK
wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Last saved by

Sorry - I am at a loss with this one

"JLGWhiz" wrote:

You enter it into a worksheet by making a variable equal to the return value
of the built in properties:

userName = ThisWorkbook.BuiltInDocumentProperties("Author").V alue
ActiveSheet.ActiveCell = userName


"JohnUK" wrote:

Many thanks Chip, but I am not sure how I would enter that into a code so
that it would paste those values into the cells of a worksheet.
John

"Chip Pearson" wrote:

You can get the name of the file with

ThisWorkbook.Name 'or
ThisWorkbook.FullName.

You can get the original author of the file with

ThisWorkbook.BuiltInDocumentProperties("Author").V alue

You can get the last-saved-by user with

ThisWorkbook.BuiltInDocumentProperties("Last Author").Value

These two values return the name that is entered as the "User Name" in
the Options dialog box. This is not the user's logon id.

You can get the last save time with

FileDateTime(ThisWorkbook.FullName)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Sat, 29 Nov 2008 09:39:01 -0800, JohnUK
wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Last saved by

I'll pass this along for reference anyhow. I got it on the en.allexperts.com
site.

Remarks
This property returns the entire collection of built-in document properties.
Use the Item method to return a single member of the collection (a
DocumentProperty object) by specifying either the name of the property or the
collection index (as a number).

You can refer to document properties either by index value or by name. The
following list shows the available built-in document property names:

Title
Subject

Author

Keywords

Comments

Template

Last Author

Revision Number

Application Name

Last Print Date
Creation Date
Last Save Time

Total Editing Time

Number of Pages

Number of Words

Number of Characters

Security

Category

Format

Manager
Company
Number of Bytes

Number of Lines

Number of Paragraphs

Number of Slides

Number of Notes

Number of Hidden Slides

Number of Multimedia Clips

Hyperlink Base

Number of Characters (with spaces)



Container applications aren't required to define values for every built-in
document property. If Microsoft Excel doesn't define a value for one of the
built-in document properties, reading the Value property for that document
property causes an error.


"JohnUK" wrote:

Sorry - I am at a loss with this one

"JLGWhiz" wrote:

You enter it into a worksheet by making a variable equal to the return value
of the built in properties:

userName = ThisWorkbook.BuiltInDocumentProperties("Author").V alue
ActiveSheet.ActiveCell = userName


"JohnUK" wrote:

Many thanks Chip, but I am not sure how I would enter that into a code so
that it would paste those values into the cells of a worksheet.
John

"Chip Pearson" wrote:

You can get the name of the file with

ThisWorkbook.Name 'or
ThisWorkbook.FullName.

You can get the original author of the file with

ThisWorkbook.BuiltInDocumentProperties("Author").V alue

You can get the last-saved-by user with

ThisWorkbook.BuiltInDocumentProperties("Last Author").Value

These two values return the name that is entered as the "User Name" in
the Options dialog box. This is not the user's logon id.

You can get the last save time with

FileDateTime(ThisWorkbook.FullName)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Sat, 29 Nov 2008 09:39:01 -0800, JohnUK
wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Last saved by

The code I posted was VBA code, not formula code. You need to create a
User Defined Function in VBA. Press ALT F11 to open the VBA Editor
(VBE). There, press CTRL R to display the Project Explorer window if
it is not already visible (typically on the left side of the screen).
Find your project workbook in the Project Explorer, select it, then go
to the Insert menu and choose Module. This will create a code module
named Module1 in your workbook's VBA Project. In that module, enter
the following code:


Function GetProp(PropName As String, _
Optional Reference As Excel.Range) As Variant
On Error GoTo ErrH:
Dim DocProps As Office.DocumentProperties
Dim WB As Excel.Workbook
If Reference Is Nothing Then
Set WB = ThisWorkbook
Else
Set WB = Reference.Parent.Parent
End If
Set DocProps = _
WB.BuiltinDocumentProperties
GetProp = CStr(DocProps(PropName).Value)
Exit Function
ErrH:
GetProp = CVErr(xlErrValue)
End Function


Now, close the VBE.

Back in Excel, you can call this function from a cell with a function
like

=GetProp("Author")

Change "Author" to the name of the property whose value you want to
return. If the property doesn't exist or isn't set, the function
returns a #VALUE error. If Reference is not specified, the property is
read from the workbook that contains the code. To look up a property
in another (open) workbook, pass a reference to that workbook as the
Reference. For example, to get the Author property of Book3.xls, use

=GetProp("Author",[Book3.xls]Sheet1!A1)

It doesn't matter what reference you pass to GetProp as long as it
refers to a cell in the workbook whose properties you want to
retrieve.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Sat, 29 Nov 2008 10:03:01 -0800, JohnUK
wrote:

Many thanks Chip, but I am not sure how I would enter that into a code so
that it would paste those values into the cells of a worksheet.
John

"Chip Pearson" wrote:

You can get the name of the file with

ThisWorkbook.Name 'or
ThisWorkbook.FullName.

You can get the original author of the file with

ThisWorkbook.BuiltInDocumentProperties("Author").V alue

You can get the last-saved-by user with

ThisWorkbook.BuiltInDocumentProperties("Last Author").Value

These two values return the name that is entered as the "User Name" in
the Options dialog box. This is not the user's logon id.

You can get the last save time with

FileDateTime(ThisWorkbook.FullName)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Sat, 29 Nov 2008 09:39:01 -0800, JohnUK
wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Last saved by

For item #3, use:

Environ("username")
--
Gary''s Student - gsnu200816


"JohnUK" wrote:

Is there a way of entering into cells (below each other)
1. The name of the file
2. Last person who saved the file
3. Last person accessed the file
4. Date and time last saved?
Help greatly appreciated
John

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
How do I recover an Excel document saved not saved as Darryl Excel Discussion (Misc queries) 6 January 5th 10 03:39 AM
i "saved" instead of "saved as". I need old file back KD Excel Discussion (Misc queries) 5 October 13th 09 08:32 AM
Why is Referenced Workbook Saved When ActiveWorkbook is Saved? RyanH Excel Programming 1 October 29th 08 08:20 PM
How can I see a copy of a saved workbook before I saved it again? Norma Excel Worksheet Functions 2 May 11th 05 10:31 AM
How to get saved old saved work that was saved over? Maral Excel Discussion (Misc queries) 1 February 20th 05 08:59 PM


All times are GMT +1. The time now is 05:34 PM.

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"