Hi Vish,
Under the tools menu in the Visual Basic Editor in Excel (invoked by Alt+F11) choose References option and enable (tick the checkbox) the following references (files found in the \Program Files\Common Files\Microsoft Shared\OFFICE** folder):
Note: ** will change based on the Office version used.
1. Microsoft Office 12.0 Object Library (found in Common Files\Microsoft Shared\OFFICE**\mso.dll)
2. Microsoft ActiveX Data Objects 2.7 Library (found Common Files\System\ado\msado27.tlb)
Then, include the below code in a standard module
Store and execute the query inorder to choose records from the database table at the click of a button (cmdExtract button code).
In case of any queries, do let me know.
Sarang
Bookmarks