Any of the Words
Link to us
Read Excel Data
Click to e-mail author
There is a Procedure to Read Excel data in Easiest way. Once u read the data it is easy to insert into database.
Lib Reference: Microsoft Excel 11.0 Object Library ' If u not found 11.0 u can fined lower version Dim WithEvents xlBook As Excel.Workbook ' Declare it on Top
' Write This in Any command button 'Here U mention ur Excel File name Set xlBook = GetObject(App.Path & "\SampleData.xls") xlBook.Application.Visible = True xlBook.Windows(1).Visible = True xlBook.Application.WindowState = xlMinimized Dim irow As Integer Dim jcol As Integer 'There r 3 rows X 3 columns in excel sheet For irow = 2 To 4 For icol=1 to 3 msgbox xlBook.Worksheets(1).Cells(irow, icol).Value next next 'Create this is an excel sheet and We have rows and ' colums like this Data is started from 2nd row so we 'mentioned in First for loop starts from 2 to till 4 ' 1st col 2nd col 3rd col ' sno name sal 1st row ' 1 Nagendra 223 2nd row ' 2 Magdhum 223 3rd row ' 3 Bhaskar 223 4th row
© 2016 A1VBCode. All rights reserved.