Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

Error 424---- Se Requiere Un Objeto

Estas en el tema de Error 424---- Se Requiere Un Objeto en el foro de Visual Basic clásico en Foros del Web. HOLA TENGO EL SIGUIENTE CODIGO, QUIERO ENVIAR CORREOS A LOS USUARIOS Q FALTAN DE MANDAR 1 REPORTE MENSUAL. MI PROBLEMA ES QUE ME MANDA ERROR ...
  #1 (permalink)  
Antiguo 30/01/2008, 18:33
 
Fecha de Ingreso: noviembre-2007
Mensajes: 39
Antigüedad: 16 años, 5 meses
Puntos: 0
Error 424---- Se Requiere Un Objeto

HOLA TENGO EL SIGUIENTE CODIGO, QUIERO ENVIAR CORREOS A LOS USUARIOS Q FALTAN DE MANDAR 1 REPORTE MENSUAL. MI PROBLEMA ES QUE ME MANDA ERROR 424---- SE REQUIERE UN OBJETO... YA NO TENGO IDEA DE COMO RESOLVERLO..... HACE TODO LO Q LE PIDO, SOLO Q CUANDO ESCOJO AL USUARIO Y ENVIO EL MENSAJE ME MANDA ESE ERROR

Private Sub btn_send_Click()
Dim strMail As String
Dim strBuffer As String
Dim iRetWrite As Long


strMail = ""
If AdminTool.rd_comppending.Value = True Then
For i = 1 To lst_signatures.ListItems.count
strMail = strMail & lst_signatures.ListItems.Item(i) & "@dfdff.dfdf, "
Next i
strMail = Left(strMail, Len(strMail) - 2)
Else
Set rst = New ADODB.Recordset
strSQL = " SELECT signature " & _
" FROM appusr_profile, department " & _
" WHERE department.name = '" & Tool.txt_trpdept.Text & "' " & _
" AND appr_dept_id = department.id " & _
" AND isDrag = 1"

rst.Open strSQL, de_TimeDB.cnn_TimeDB, adOpenStatic, adLockReadOnly, adCmdText

Do While Not rst.EOF
strMail = Trim(rst!signature) & "@dfdfdf.dfdf"
rst.MoveNext
Loop

'clean up
rst.Close
Set rst = Nothing
End If

On Error GoTo ErrorHandler

'Preparar Mail
MailMessage1.action = 8
MailMessage1.To = strMail
MailMessage1.From = "[email protected]" 'cuenta
MailMessage1.Text = Trim(Tool.txt_trpmessage.Text)
MailMessage1.Date = Format(Now, "yyyymmddhhmmss")
MailMessage1.Subject = Trim(Tool.txt_trpsubject.Text) & " Week: " & Trim(Tool.txt_trpweek.Text)

'Mandar mensaje
SmtpClient1.AutoResolve = True
SmtpClient1.Blocking = True
SmtpClient1.HostName = "aaaaa.dfdfd.dfdf"

If SmtpClient1.Connect() <> 0 Then
MsgBox "Connecting to SMTP server failure"
SmtpClient1.LastError = 0
Exit Sub
End If

'Identify ourselves to the server
SmtpClient1.Address = "[email protected]"
If SmtpClient1.AddressMail <> 0 Then
MsgBox "No source address was specified"
SmtpClient1.LastError = 0
Exit Sub
End If

' Send recipient addresses to the server
SmtpClient1.Recipient = strMail
If SmtpClient1.Recipient = "" Then
MsgBox "No destiny address was specified"
SmtpClient1.LastError = 0
Exit Sub
End If

strBuffer = ""
Clipboard.clear

If MailMessage1.ExportFile(strBuffer) <> 0 Then
MsgBox "Exporting file failure"
MailMessage1.LastError = 0
Exit Sub
End If

strBuffer = Clipboard.GetText
Clipboard.clear

While Len(strBuffer) > 0
iRetWrite = SmtpClient1.Write(strBuffer, 2048)
If iRetWrite < 0 Then
MsgBox "Error while writing to SMTP server " & SmtpClient1.LastError
SmtpClient1.LastError = 0
Exit Sub
End If
strBuffer = Right(strBuffer, Len(strBuffer) - iRetWrite)
Wend

SmtpClient1.SendMail
MsgBox "E-mail message has been succesfully sent", vbInformation
SmtpClient1.Disconnect

RReport.Hide
Unload RReport

Exit Sub

ErrorHandler:

If Err <> 0 Then
MsgBox Err.Number & "-->" & Err.Description, , "Error"
End If

End Sub


GRACIAS
  #2 (permalink)  
Antiguo 06/02/2008, 10:17
 
Fecha de Ingreso: agosto-2006
Mensajes: 6
Antigüedad: 17 años, 8 meses
Puntos: 0
Re: Error 424---- Se Requiere Un Objeto

Hola, el error de que hablas es usual en vb, cuando declaras un objeto o intentas acceder a este sin que exista en realidad. Como no se que objetos o no tienes en el formulario, no puedo ayudarte. Tienes que ver en que linea te declara el error y ver que no has declarado.
puede ser desde una referencia en el proyecto, hasta un objeto dentro del formulario.
postea la linea del error si requieres mas ayuda.
  #3 (permalink)  
Antiguo 24/05/2012, 11:20
 
Fecha de Ingreso: mayo-2012
Mensajes: 1
Antigüedad: 12 años
Puntos: 0
Respuesta: Error 424---- Se Requiere Un Objeto

En el sistema Berjerman, en "Gestion de Estudio", Ingreso de comprobantes, Preparar/emitir, me sale el mismo mensaje: error 424 y en detalle dice " se requiere un objeto".- Alguien sabe como solucionarlo ?

Gracias

Última edición por jvnuciari; 24/05/2012 a las 11:22 Razón: lugar equivocado
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:25.