Add data to a table with multiply columns in a closed workb

  • In this example I will show how we can add data to a table with multiply columns in a closed workbook.


    What we need:
    * MS Windows 2000 or above
    * MS Excel 2000 or above
    * MDAC 2.5 or above (ADO Library)


    Step 1
    Add a reference to MS ADO Library x.x via Tools | Reference... in the VB-Editor.


    Step 2
    Insert following code in a standardmodule:


    If we experience that the procedure is running slow we can consider to disconnect the recordset, add the data, and then connect the recordset for updating the table.


    As usual comments are appreciated.


    Kind regards,
    Dennis