Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/10/2010, 11:51
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Como guardar en una celda especifica de excel 2003 especifica usando visua

Hola!!
Adapta este código al tuyo, lo he utilizado y me funciona:

Código vb:
Ver original
  1. Dim strUp As String
  2.         Dim RegIns As Integer
  3.  
  4.         Set ExcelConn = New ADODB.Connection
  5.  
  6.         With ExcelConn
  7.             .Provider = "MSDASQL"
  8.             .ConnectionString = "Driver={Microsoft Excel Driver (*.xls)};" & _
  9.             "DBQ=" & Trim(Ruta_Archivo_Excel) & ".xls; ReadOnly=False;"
  10.             ExcelConn.Open
  11.         End With
  12.  
  13.         strUp = "UPDATE [NOMBRE_HOJA$] SET [CAMPO_DETALLE]='" & Trim(txtValor_Campo_Detalle.Text) & "' WHERE [CAMPO_CLAVE]='" & _
  14.             Trim(txtValor_Campo_Clave.Text) & "'"
  15.  
  16.         ExcelConn.Execute strUp, RegIns
  17.  
  18.         If RegIns = 1 Then
  19.             MsgBox "Registro actualizado.", vbInformation
  20.         Else
  21.             MsgBox "No se actualizó el registro." & vbNewLine & "Verificar datos.", vbExclamation
  22.         End If
  23.  
  24.         ExcelConn.Close
  25.         Set ExcelConn = Nothing

Nos cuentas!!