I'm not an expert on the VBA and struggle to build a string for a path and file:
I have a workbook ?Inc(Auto).xls? that is linked to another workbook, ?GLB.xls?, that is saved in the same folder as ?Inc(Auto).xls?
Since these files are copied together to other folders by users, I would like to obtain the date and time of ?GLB.xls? in the ?newly? saved user?s folder by running VBA code to have the result pasted in Inc(Auto).xls in cell C2
My problem is with creating the string name ?MyFullPath?. I?m missing something here? Any help will be valuable.
Sub GetFildeDateTime()
Dim DResult As Date
Dim MyPath, MyFile, MyFullPath As String
MyPath = Application.ActiveWorkbook.Path
MyFile = "\GLB.xls"
MyFullPath = MyPath + MyFile
DResult = FileDateTime(MyFullPath)
Range("C2") = "Last updated: " & DResult
End Sub
Bookmarks