Visual Basic - Se pega, al copiar filas, Excel a una tabla

Life is soft - evento anual de software empresarial
 
Vista:

Se pega, al copiar filas, Excel a una tabla

Publicado por Victor Machuca (4 intervenciones) el 27/01/2005 22:11:13
Hola, estoy copiando filas desde Excel a una tabla en access-97, copia ciertas filas y luego se pega, favor revisar este codigo, ¿ puede faltar algo?, gracias.
Victor Machuca

Dim libro As Excel.Application
Set libro = CreateObject("Excel.Application")
Dim hoja As Excel.Worksheet
With libro
.Workbooks.Open "c:\trabajo.xls"
.Visible = False
Set hoja = .Worksheets("final")
fila = 2
Do While hoja.Cells(fila, 1) <> "" And Not IsNull(hoja.Cells(fila, 1))
Dsprepauta.AddNew
Dsprepauta.ptafab = hoja.Cells(fila, 1)
Dsprepauta.ptatem = hoja.Cells(fila, 2)
Dsprepauta.ptagru = hoja.Cells(fila, 3)
Dsprepauta.ptaarti = hoja.Cells(fila, 4)
Dsprepauta.ptahor = hoja.Cells(fila, 5)
Dsprepauta.ptamatga = hoja.Cells(fila, 6)
Dsprepauta.ptacolga = hoja.Cells(fila, 7)
Dsprepauta.ptamatcga = hoja.Cells(fila, 8)
Dsprepauta.ptacolcga = hoja.Cells(fila, 9)
Dsprepauta.tacd = hoja.Cells(fila, 10)
Dsprepauta.Update
fila = fila + 1
Loop
.Quit
Set hoja = Nothing
Set libro = Nothing
End With
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder