Home » excel » vb.net – Getting Started With Writing a File to Excel in Visual Basic

vb.net – Getting Started With Writing a File to Excel in Visual Basic

Posted by: admin April 23, 2020 Leave a comment

Questions:

I have data that I want to have written into a Microsoft Excel File.

I found the following question, but this is using a predefined name where as I want to use a Save Command Window on a menu bar.

Coding for Excel sheet in Visual Basic 6

Essentially I have two columns of data, Participant Name & Time In Ring, I want to cycle through an array (I suppose) and have each item on its own line.

Can anyone show me where or how to get started with this?

How to&Answers:

The easiest way is to create csv document. Use System.IO.StreamWriter class and append comma separated string (e.g 10,abc,10.20) at each line.

You may also use ADO.NET Oledb provider and OfficeInter Op API.