Good afternoon,
Is there a way to speed up the below code script? It runs perfectly for what it does, but its terribly slow.
Any advise or an alternative script to that below?
Many thanks
M
Sub GetFileAttributes()
Dim objFSO As Object
Dim objFile As Object
Dim filePath As String
Dim Lastrow As Long
Dim i As Long
Set objFSO = CreateObject("Scripting.FileSystemObject")
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
filePath = Cells(i, 1).Value
If objFSO.FileExists(filePath) Then
Set objFile = objFSO.GetFile(filePath)
Cells(i, 2).Value = objFile.DateCreated
'Cells(i, 3).Value = objFile.DateLastModified
Else
Cells(i, 2).Value = "File not found"
'Cells(i, 3).Value = "File not found"
End If
Next i
Set objFSO = Nothing
Set objFile
Is there a way to speed up the below code script? It runs perfectly for what it does, but its terribly slow.
Any advise or an alternative script to that below?
Many thanks
M
Sub GetFileAttributes()
Dim objFSO As Object
Dim objFile As Object
Dim filePath As String
Dim Lastrow As Long
Dim i As Long
Set objFSO = CreateObject("Scripting.FileSystemObject")
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
filePath = Cells(i, 1).Value
If objFSO.FileExists(filePath) Then
Set objFile = objFSO.GetFile(filePath)
Cells(i, 2).Value = objFile.DateCreated
'Cells(i, 3).Value = objFile.DateLastModified
Else
Cells(i, 2).Value = "File not found"
'Cells(i, 3).Value = "File not found"
End If
Next i
Set objFSO = Nothing
Set objFile