July 6th, 2022

VBA 2010 – 098: ADODB +FSO = Amazing

Uses FileSystemObject to search for files and then ADODB to connect to them and extract all their data.
Download the samples for this series for free!

All our tutorial samples are free however if you appreciate our work and would like to make a voluntary donation then please do.

Recommended Reading

Both the below books by John Walkenbach are fantastic books and he is a brilliant author, I would recommend picking one of these books up even if just for a reference. I have read power programming cover to cover and it is easy to follow and is a must have for any serious VBA programmer.

If you have read any books and feel they are worth recommending then please post about them on our Forum.

VBA 2010 – 097: Open all files in a Folder

VBA 2010 – 100: Creating Formulas

One Comment

  1. Edward
    October 6, 2015

    Dear Sir,
    after using adodb + fso to open the files one by one to get the data needed with rs. In the middle of retrieving data, can for loop be done! because i want specific data when type unique id. like a filter function. Below code which current using on fso without adodb.
    For Each oFile In oFolder.Files

    Workbooks.Open (oFile)
    Finalrow = Sheets(“Data”).Range(“B1000″).End(xlUp).row
    For i = 4 To Finalrow
    If Cells(i, 2) = athletename Then
    Range(Cells(i, 2), Cells(i, 8)).Copy
    sourcesheet.Range(“P100″).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    Application.CutCopyMode = False

    End If
    Next i
    ActiveWorkbook.Close SaveChanges:=False
    Next oFile

    After watch your video, i come out an idea to change it.

    with your help would be much appreciate

    Thank you in advance


Leave a comment

Your email address will not be published. Required fields are marked *