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
The simplest solution is if you write a csv file. In the csv the columns are separated with comma (;) and the excel can read this file.
The best way is the OLE Automation but for this you have to install an excel to the pc where your program runs. Here is a sample: OLE Automation