Hola amigo, alli te va una que uso sin problemas:
*============================================================
cFileName = Getfile("XLS")
Thisform.txt_excel.Value = Justfname(cFileName)
Thisform.cFile = cFileName
If File(Thisform.cFile)
#Define xlLandscape 2
#Define xlDoNotSaveChanges 2
Select crsListaIndice
Zap
loExcel = Createobject("Excel.application")
With loExcel
.Application.Workbooks.Open(Thisform.cFile)
.Visible = .T. && Muestro Excel
For i = 1 To loExcel.activeworkbook.sheets.Count
cHoja = Alltrim(Upper(loExcel.activeworkbook.sheets[i].Name))
loExcel.activeworkbook.sheets[i].Activate
lnCol = .ActiveSheet.UsedRange.Columns.Count && -- Cantidad de columnas
lnFil = .ActiveSheet.UsedRange.Rows.Count && -- Cantidad de filas
*--------------------------------------------
For fila=2 To lnFil
Select crsListaIndice
Append Blank
Replace crsListaIndice.num_escritura With Thisform.vacio(loExcel.activeworkbook.ActiveSheet.Cells(fila, 1).Value, "N")
Replace crsListaIndice.objeto With Thisform.vacio(loExcel.activeworkbook.ActiveSheet.Cells(fila, 2).Value, "C")
Replace crsListaIndice.otorgantes With Thisform.vacio(loExcel.activeworkbook.ActiveSheet.Cells(fila, 3).Value, "C")
Replace crsListaIndice.fecha With Thisform.vacio(loExcel.activeworkbook.ActiveSheet.Cells(fila, 4).Value, "DT")
Replace crsListaIndice.afavor With Thisform.vacio(loExcel.activeworkbook.ActiveSheet.Cells(fila, 5).Value, "C")
Replace crsListaIndice.folio With Thisform.vacio(loExcel.activeworkbook.ActiveSheet.Cells(fila, 6).Value, "C")
Next fila
Next i
.ActiveWindow.Close(xlDoNotSaveChanges)
.Quit()
Endwith
Clear Resources Thisform.cFile
Select crsListaIndice
Go Top
Thisform.grid11.Refresh
Endif
*======================================================================
Saludos cordiales.Managua, Nicaragua
Centroamérica