Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,


Please help me
I want to import excel sheet data in data grid in vb.net.
Posted
Comments
criselda 8-Mar-13 1:39am    
http://stackoverflow.com/questions/13739912/importing-excel-file-to-datagridview

First you need to import the library which is required to handle Excel files. Doing so will allow you not only to import Excel files, but to edit and save (create) them.

Use:
VB
Imports Excel = Microsoft.Office.Interop.Excel 

at the beginning of your program.

There are 3 elements you need to set to something, in order to access the Excel file:

Excel.Application - for the entire Excel interfacing
Excel.Workbook - should point to the actual Excel file (.xls or .xlsx)
Excel.Worksheet - should point to the worksheet you with to import from.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900