Quote Originally Posted by p45cal View Post
You have put the second block of code into its own separate standard code module, that is, not part of the userform's code module?
If so attach a workbook so I can see what's going on, otherwise I'm working blind.

2022-02-16_205114.jpg

Ok, that was my error, I didnt realize I should create a new Module. As I said, I am really unfamiliar with this, so my apologies again. I moved the code to a separate code module, instead of the Userform's code module. Upon running it I received a "Run-time error '76': path not found" message, and debug took me to the line

LoopAllSubFolders FSOLibrary.GetFolder(folderName), strFileSpec

Looking above that is seems that this may have inadvertently been left in:

folderName = "C:\Users\Pascal\Documents" 'Me![SearchDir]

So I removed the path reference to make it

folderName = Me![SearchDir]

in order to point it to the path and directory where I want to search for the excel files (input into the form). This got it past the previous line it got stuck on, but then it stopped with:

"Run-time error '3706': Provider cannot be found. It may not be properly installed"

and debug takes me to

With cnn2
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & varFile & ";Extended Properties=Excel 8.0;"
.Open

getting stuck on .Open


I have tried to upload a simplified version of the .mdb file to this post, but it will not allow me, it seems you can only upload .accdb files? I then tried to transfer everything to a new blank .accdb file, and that seems to create new problems... Starting to get really lost here. Again thanks for the help and sorry for being such a novice.