Display external data inside of an Excel 2007 Spread sheet
Put the following code in the ThisWorkbook module:
Private Sub Workbook_Open()
Dim objFile As Object
Dim objShell As Object
Dim objFolder As Object
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(ThisWorkbook.Path)
For Each objFile In objFolder.items
Debug.Print objFolder.getdetailsof(objFile, 0)
If objFolder.getdetailsof(objFile, 0) = _
ThisWorkbook.Name Then Exit For
Next objFile
Call MsgBox("Last date modified: " & _
objFolder.getdetailsof(objFile, 3))
End Sub
Save in a macro-enabled file format, enable macros, save and reopen.
On Nov 14, 1:35 pm, jingles457
wrote:
How can I get Excel 2007 to display the "Date Modified" field of the
worksheet being opened?
|