Import EXCEL data into Visual Studio 2019

Surendra Singh 1 Reputation point
2021-03-01T18:32:50.433+00:00

Can any one suggest me where to look for VB code for importing data from EXCEL into Visual Studio 2019

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,558 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 81,356 Reputation points
    2021-03-01T18:46:21.983+00:00
    0 comments No comments

  2. Karen Payne MVP 35,026 Reputation points
    2021-03-01T19:28:42.78+00:00

    Either way, there is not one ideal method that will work for every file, you will need to tinker with the code in many cases dependent on how things are structured and if there are mixed types in columns which is shown in this code sample for OleDb.

    I have a bunch of code samples here.


  3. David 146 Reputation points
    2021-03-29T09:21:53.647+00:00

    Try this solution. More details can be found through this link - https://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Excel-Import/Export-Import-Data-from-Excel-to-Datatable.html

    Dim workbook As Workbook = New Workbook
    workbook.LoadFromFile(..\ FandH.xlsx)
    Dim sheet As Worksheet = workbook.Worksheets(0)
    Me.dataGridView1.DataSource = sheet.ExportDataTable
    
    0 comments No comments