por que no me funciona mi macro es para mandar correo y se deiene aqui
Set oSess = CreateObject("Notes.NotesSession")
anexo el completo
Function CORREO()
Application.ScreenUpdating = False
Dim oSess As Object
Dim oDB As Object
Dim oDoc As Object
Dim oItem As Object
Dim direct As Object
Dim Var As Variant
Dim flag As Boolean
Dim lista(40) As Variant
Application.Workbooks("REPORTE DE TURNO.xlsx").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.Workbooks("REPORTE MTTO MOD.xlsm").Activate
Sheets("CORREO").Select
I = 0
J = 2
INICIO:
If Range("B" & J) = "" Or J = 42 Then
GoTo FIN
Else
lista(I) = Range("B" & J).Text
End If
I = I + 1
J = J + 1
GoTo INICIO
Sheets("FORMATO").Select
FIN:
Set oSess = CreateObject("Notes.NotesSession")
Set oDB = oSess.GETDATABASE("", "")
Call oDB.OPENMAIL
flag = True
If Not (oDB.IsOpen) Then flag = oDB.Open("", "")
If Not flag Then
MsgBox "Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH
GoTo exit_SendAttachment
End If
On Error GoTo err_handler
'Building Message
Set oDoc = oDB.CREATEDOCUMENT
Set oItem = oDoc.CREATERICHTEXTITEM("BODY")
oDoc.Form = "Memo"
oDoc.Subject = "REPORTE DE TURNO" '"PRUEBA DE REPORTE"
oDoc.sendto = lista
oDoc.body = "ESTE ES EL REPORTE DE TURNO Y LAS GRAFICAS HASTA EL DIA DE HOY" '"PRUEBA DE FUNCIONAMIENTO DE REPORTE DE TURNO"
oDoc.postdate = Date
oDoc.SAVEMESSAGEONSEND = True
'Attaching DATABASE
Call oItem.EMBEDOBJECT(1454, "", "S:\COMPLEX\ENSAMBLE\ADM 003 PINTURA\002 MANTENIMIENTO (Alex Lopez)\04 RESPUESTA\REPORTE DE EFICIENCIA\REPORTES DE MTTO\FALLAS\REPORTE DE TURNO.xlsx")
oDoc.visable = True
'Sending Message
oDoc.SEND False
exit_SendAttachment:
On Error Resume Next
Set oSess = Nothing
Set oDB = Nothing
Set oDoc = Nothing
Set oItem = Nothing
'Done
Exit Function
err_handler:
If Err.Number = 7225 Then
MsgBox "File doesn't exist"
Else
MsgBox Err.Number & " " & Err.Description
End If
On Error GoTo exit_SendAttachment
Application.ScreenUpdating = True
End Function
espero me puedas ayudar
Saludos............
Cuando se detiene ¿qué error da?
Si es simplemente que no reconoce ese tipo de objeto, es que no encuentra en el equipo la biblioteca de lotus notes, pero me imagino que si lo tienes instalado en tu equipo esa biblioteca sí estará accesible y el error será otro, aunque se detenga en la primera linea.
Mira esta página http://www.rondebruin.nl/win/s1/notes/notes.htm
------
Ya sé Excel, pero necesito más.
GRACIAS POR LA INFORMACION EL DETALLE ES QUE AMI MI CORREO ME PIDE CONRASEÑA PERO HICE LA PRUEBA CON UNA CORREO QUE NO PIDE CUENTA Y FUNCIONO DE MARAVILLA...