RE:consulta de datos desde excel
mira aqui tengo un pedazo de codigo, antes tienes que poner un common dialog en tu forma y en las referencias agregar microsoft exel component.
CMD = commondialog
Flex = flex grid control
cualquier cosa nomas me dices si no le entiedes.
-------------------------------------------------------------------------------------------------------
CMD.CancelError = True
On Error GoTo ErrHandler
CMD.Flags = cdlOFNHideReadOnly
CMD.Filter = "Archivo de Excel " & "(*.xls)|*.xls"
CMD.FilterIndex = 2
CMD.ShowOpen
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
'Aqui creas las instancias para abrir una hoja de calculo:
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(CMD.FileName)
'Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1) '(1) referencia a hoja 1
Flex.Cols = 3
Flex.ColWidth(0) = 1000
Flex.ColWidth(1) = 3500
Flex.ColWidth(2) = 2000
Flex.TextMatrix(0, 0) = "Matricula"
Flex.TextMatrix(0, 1) = "Concepto"
Flex.TextMatrix(0, 2) = "Total"
Flex.Row = 0
Flex.Col = 0
Flex.CellFontBold = True
Flex.CellAlignment = 4
Flex.Col = 1
Flex.CellFontBold = True
Flex.CellAlignment = 4
Flex.Col = 2
Flex.CellFontBold = True
Flex.CellAlignment = 4
'Asi pasas valores a una celda:
For X = 1 To 500
Flex.TextMatrix(X, 0) = Format(xlSheet.Cells(X, 1).Value, "00000")
Flex.TextMatrix(X, 2) = xlSheet.Cells(X, 4).Value
Flex.TextMatrix(X, 1) = xlSheet.Cells(X, 5).Value
If xlSheet.Cells(X, 5).Value = "" Then
Flex.Rows = Flex.Rows - 1
Exit For
End If
Flex.Rows = Flex.Rows + 1
Next X
'Asi terminas el proceso:
'ruta = "\Transferir\Transferir " + Format(Date1, "dd mm yyyy") + ".xls"
'xlSheet.SaveAs (App.Path & ruta)
xlSheet.Application.Quit
Set xlSheet = Nothing
Exit Sub
ErrHandler:
Exit Sub