Source code documentation samples provide quick and easy way to add a required functionality into your application. ByteScout Spreadsheet SDK is the library (SDK) that is capable of writing, reading, modifying and calculating Excel and CSV spreadsheets. Most popular formulas can be calculated and reculculated with Excel installed. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays. It can be used to import from list using VB.NET.
You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout Spreadsheet SDK for import from list below and use it in your application. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Implementing VB.NET application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.
Our website provides trial version of ByteScout Spreadsheet SDK for free. It also includes documentation and source code samples.
Imports System.IO Module Module1 Sub Main() Const fileName As String = "VBNetImportFromList.xls" 'Create a new spreadsheet Dim spreadsheet As Bytescout.Spreadsheet.Spreadsheet = New Bytescout.Spreadsheet.Spreadsheet 'Get the data from the jagged array that we want to import Dim list As IList = GetList() 'Import data into spreadheet spreadsheet.ImportFromList(list) 'Save the spreadsheet If (File.Exists(fileName)) Then File.Delete(fileName) End If spreadsheet.SaveAs(fileName) 'Close spreadsheet spreadsheet.Close() 'Open the spreadsheet Process.Start(fileName) End Sub ''' <summary> ''' Creates a list of planets ''' </summary> ''' <returns>A list of planets</returns> ''' <remarks></remarks> Function GetList() As IList Dim planets(9, 1) As String planets(0, 0) = "Mercury" planets(1, 0) = "Venus" planets(2, 0) = "Earth" planets(3, 0) = "Mars" planets(4, 0) = "Jupiter" planets(5, 0) = "Saturn" planets(6, 0) = "Uranus" planets(7, 0) = "Neptune" planets(8, 0) = "Pluto" Return planets End Function End Module