Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Scripting FileSystemObject creates Runtime 429 error on Windows

$
0
0

Am I missing a reference object? Trying to retrieve a list of files in a directory and have them show in a sheet.

Also, would it be possible to get the directory location from a specific cell in the file?

Sub LoopThroughFiles()

Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set oFolder = oFSO.GetFolder("C:\VBA Folder")

For Each oFile In oFolder.Files

    Cells(i + 1, 1) = oFile.Name

    i = i + 1

Next oFile

End Sub

Here:

Set oFSO = CreateObject("Scripting.FileSystemObject")

Runtime error 429 on a Windows machine.


Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>