Hi, I currently have the below code to pull a list from a file path every time the worksheet is activated.
Sub worksheet_Activate()
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("Y:\A6 Training\Note Templates\Disputes")
i = 1
For Each objFile In objFolder.Files
Cells(i + 1, 62) = objFile.Name
i = i + 1
Next objFile
End Sub
This works well, however the code is now pulling ~$files which I understand is when the word docs that I'm pulling through are open.
Please can somebody advise if they know a way of stopping the hidden files pulling through?
Thanks in advance
Sub worksheet_Activate()
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("Y:\A6 Training\Note Templates\Disputes")
i = 1
For Each objFile In objFolder.Files
Cells(i + 1, 62) = objFile.Name
i = i + 1
Next objFile
End Sub
This works well, however the code is now pulling ~$files which I understand is when the word docs that I'm pulling through are open.
Please can somebody advise if they know a way of stopping the hidden files pulling through?
Thanks in advance