Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default UDF Last Save Date returning 3 different results

I would like to create a user defined function (UDF), to return the file save
date, the user name who saved the file, and if the file is open for editing
the user name who is editing the file for a series of files that are
summarized on a sheet in a separate summary workbook. The only input is the
filename. The other files are in the current directory right now, but I would
like the option of entering the full path so that this function can report on
files that are in other directories as well.

Basically I will enter the filename in column A and the modifed date, etc,
is returned in column B.

For example:

A1 :FileName.XLS
B1 : =LastSave(A1)

UDF formula returns - Modified Date: 10/28/08 3:00pm Saved by: NOTSO

OR If FileName.XLS does not exist in the current directory, then UDF
returns "FileName.XLS NOT Found"

OR If FileName.XLS is open or in use by another user, then UDF returns
the last date modified with a note appended; for example *** Modified Date:
10/28/08 3:00pm Saved by: NOTSO (currently being edited by USERNAME)

Thank you, NOTSO
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,805
Default UDF Last Save Date returning 3 different results

Try to adapt this;
(example is from Excel Help)

Sub ShowFileAccessInfo(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = f.Name & " on Drive " & UCase(f.Drive) & vbCrLf
s = s & "Short Name: " & f.ShortName & vbCrLf
s = s & "Created: " & f.DateCreated & vbCrLf
s = s & "Parent Folder: " & f.ParentFolder & vbCrLf
s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
s = s & "Last Modified: " & f.DateLastModified & vbCrLf
s = s & "Type: " & f.Type & vbCrLf
s = s & "File Size: " & f.Size & vbCrLf
MsgBox s, 0, "File Access Info"
End Sub

Sub t()
Call ShowFileAccessInfo("C:\Documents and
Settings\Sheeloo\Desktop\Test\Book1.xls")
End Sub

"notso" wrote:

I would like to create a user defined function (UDF), to return the file save
date, the user name who saved the file, and if the file is open for editing
the user name who is editing the file for a series of files that are
summarized on a sheet in a separate summary workbook. The only input is the
filename. The other files are in the current directory right now, but I would
like the option of entering the full path so that this function can report on
files that are in other directories as well.

Basically I will enter the filename in column A and the modifed date, etc,
is returned in column B.

For example:

A1 :FileName.XLS
B1 : =LastSave(A1)

UDF formula returns - Modified Date: 10/28/08 3:00pm Saved by: NOTSO

OR If FileName.XLS does not exist in the current directory, then UDF
returns "FileName.XLS NOT Found"

OR If FileName.XLS is open or in use by another user, then UDF returns
the last date modified with a note appended; for example *** Modified Date:
10/28/08 3:00pm Saved by: NOTSO (currently being edited by USERNAME)

Thank you, NOTSO

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
Returning Desired Results Wavmaster Excel Discussion (Misc queries) 5 September 9th 09 01:31 AM
VLOOKUP not returning results Chris Kellock Excel Worksheet Functions 14 March 19th 08 08:30 AM
Returning the IP results from a ping? [email protected] Excel Programming 3 March 13th 08 04:15 PM
Vlookup Returning Same Results on Each Row tlatta Excel Discussion (Misc queries) 0 December 14th 05 07:34 PM
Returning VBA results to a cell JasonSelf[_2_] Excel Programming 2 January 24th 04 05:28 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"