Dynamic File - Last Saved by

Armstrong_N14

Board Regular
Joined
Aug 19, 2023
Messages
100
Office Version
  1. 365
Platform
  1. Windows
Good Day, Everyone!
Hope this SOS finds you all in good health.
I can't seem to put the right syntax for the builtinproperties code to show the last author of a specific file due to the twist that the file that needs to show who saved it last is a different file from where the builtinproperties code is being written.

Example:
Checker.xlsm is the file that has a table that shows the breakdown of files with it's last saved time stamp and last author, in each file in the list, there is a corresponding cell that shows the path of the file where it it saved. I was able to show the last saved time stamp but not the last author(last saved by)


Sample code:

Funtion Lastauthor()

Lastauthor=Thisworkbook. Builtinproperties("Last Author")

End function

I'd like to put the file path on the Thisworkbook portion of the code but I can't seem to make it to work.

Please help me. Thanks a lot in advance.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thanks a lot, I finally got it to work, made some changes and found a helpful article on microsoft website (Redirecting)

Function DocProps(prop As String)

Dim twb As Workbook, wb As Workbook, sht As Worksheet, fPath As String, fName As String, fAuth As String
Set wb = ThisWorkbook: Set sht = wb.Worksheets("Sheet1") 'You may need to change wbWorksheets(1)
fPath = sht.Range("A2").Value: fName = sht.Range("B2").Value
Set twb = Workbooks.Add(fPath & "\" & fName)

Application.Volatile

On Error GoTo err_value
DocProps = twb.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function
 
Upvote 0
Thanks a lot, I finally got it to work, made some changes and found a helpful article on microsoft website (Redirecting)

Function DocProps(prop As String)

Dim twb As Workbook, wb As Workbook, sht As Worksheet, fPath As String, fName As String, fAuth As String
Set wb = ThisWorkbook: Set sht = wb.Worksheets("Sheet1") 'You may need to change wbWorksheets(1)
fPath = sht.Range("A2").Value: fName = sht.Range("B2").Value
Set twb = Workbooks.Add(fPath & "\" & fName)

Application.Volatile

On Error GoTo err_value
DocProps = twb.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function
Nice. Done without having to open Workbook.
 
Upvote 0
Nice. Done without having to open Workbook.
Just got disappointed, I figured it late that its showing the the last author (as the code indicates), yet what I really wanted is to show who saved it last (last touch).
sad:(
 
Upvote 0
The code above is working(incorrectly), I think it still fetches the data of the open workbook where it was written as it shows my name to every file that I have on the table (which should not be the case as my other coworker has saved the file last). Any insights please?
 
Upvote 0
The code above is working(incorrectly), I think it still fetches the data of the open workbook where it was written as it shows my name to every file that I have on the table (which should not be the case as my other coworker has saved the file last). Any insights please?
Have you stepped through your code with the Locals window open so you can check your Variables?
 
Upvote 0
Have you stepped through your code with the Locals window open so you can check your Variables?
just now, and it appears that the file needs to be open for it to be fetched properly. guess its a dead end (mean the file really needs to be opened) :(
 
Upvote 0
Well, if it works... Any specific reason you're opposed to opening the file?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top