Hi, Given a folder with a specific path, how can i get the name of the files in that folder and assign in to a string variable "Name". The plan is to go through every file in the folder one by one, and assign the name of the file to the "name" variable , and run some manipulations on it. Once the code for the manipulation is done, i will move forward. I tried the following but its not working
Code:
Dim fso As FileSystemObject
Dim fold As Folder
Dim f As File
Dim folderPath As String
Dim i As Integer
folderPath = "\\2001T44P\206850$\SynchFolder\Desktop\aaa"
Set fso = New FileSystemObject
Set fold = fso.GetFolder(folderPath)
For Each f In fold.Files
MsgBox "a"
Next
just for a test but i get an error at Set fso = New FileSystemObject, thanks.