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

Developer technologies VB
{count} votes

3 answers

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

  2. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    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 151 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.