I am getting data from my database and I want to have that data as a table in excel file. So, I have written the following :
Dim sheetToPopulate As Excel
Best way is to use XmlSerialization of the data table and then perform Excel Loading of the serialised Xml...
There is a nice open source utility (which you can add to your project and make changes to as well) called ExcelLibrary ... please refer to this article... Create Excel (.XLS and .XLSX) file from C#
This is one of the most efficient ways of Bulk Excel Loading.