Possible to get date last saved & paste to Excel?

kellonwheels

New Member
Joined
Dec 12, 2002
Messages
5
I'd like to use an Excel macro to gather the most recent saved date from the properties of an Access database. Anyone know if this is possible?

Here's the original question:

http://www.mrexcel.com/board/viewtopic.php?topic=33255&forum=2&1

Here's what I'm trying to do: I have a pivot table in Excel that gets its data from a database in Access. I can refresh the pivot table all I want, but the underlying data is only as current as the Access DB. I want to be able to show in Excel how new that data is (ie - when was the DB last modified?).

Ideas?

Thanks,

Kelly
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi,

Here's one method. Paste this function into one of your code modules: -

Code:
Function DateLastModified(FilePath As String)
Dim oFSObject As Object
On Error Resume Next
Set oFSObject = CreateObject("Scripting.FilesystemObject")
DateLastModified = oFSObject.GetFile(FilePath).DateLastModified

If Err.Number <> 0 Then
    DateLastModified = "Error: " & Err.Description
End If

End Function

This function can be used to get the date a file was last modified for any file type. You'd use it something like this: -

Code:
Sub test()
MsgBox DateLastModified("C:temptest.mdb")
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,498
Messages
6,160,160
Members
451,626
Latest member
dcobe

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