MiyagiZama
New Member
- Joined
- Jul 26, 2023
- Messages
- 18
- Office Version
- 365
- Platform
- Windows
Hello mates, hope youre fine!
When I try to run my macro in VBA, appers a pop up that says "Runtime error 440 : The object not support this method" , due to Im a newbie in this area I have not idea how to fix it, here it is the code and an screenshot of the VBA error
Thnx for your help!
When I try to run my macro in VBA, appers a pop up that says "Runtime error 440 : The object not support this method" , due to Im a newbie in this area I have not idea how to fix it, here it is the code and an screenshot of the VBA error
VBA Code:
Sub combinacioncodigo()
'
' Declaramos variables
'
Dim OutlookApp As Outlook.Application
Dim MItem As Outlook.MailItem
Dim cell As Range
Dim Asunto As String
Dim BOL As String
Dim Msg As String
'
' Seleccionamos el rango de celdas a enviar Select
'
ActiveSheet.Range("A1:M42").Select
'
'
ActiveWorkbook.EnvelopeVisible = True
'
'
'Asignamos valor a las variables y llamamos al envio
'
'
With ActiveSheet.MailEnvelope
.Item.To = ThisWorkbook.Sheets("ReporteFinal").Range("O3:O4").Value
.Item.cc = ThisWorkbook.Sheets("ReporteFinal").Range("O7").Value
'.Item.bcc = “Some email address” 'con copia oculta a...
.Item.Subject = "Programacion Linea: "
BOL = Format(ThisWorkbook.Sheets("BOL").Range("B3").Value, "#,##0")
FechaVencimiento = Format(ThisWorkbook.Sheets("BOL").Range("C3").Value, "dd/mmm/yyyy")
End With
'
'Cuerpo del mensaje
'
Msg = "Apreciables colegas, espero que se encuentren excelente el dia de hoy. " & vbNewLine & vbNewLine & vbNewLine & vbNewLine
Msg = Msg & "El motivo de este correo es para informarle que tiene material en BOL desde el: "
Msg = Msg & FechaVencimiento & "." & vbNewLine & vbNewLine & vbNewLine & vbNewLine
Msg = Msg & "Favor de apoyarnos con el plan para disminuir el numero de estas piezas: "
Msg = Msg & BOL & vbNewLine & vbNewLine
Msg = Msg & "Atentamente:" & vbNewLine
Msg = Msg & "Departamento de programacion" & vbNewLine & vbNewLine & vbNewLine
Msg = Msg & "ESTO ES UNA PRUEBA FAVOR DE OMITIR"
'
Set MItem = OutlookApp.CreateItem(olMailItem)
With MItem
.Body = Msg
.Send
'
End With
End Sub
Thnx for your help!
Last edited by a moderator: