I have a "Runtime error 440 : The object not support this method" in my macro

MiyagiZama

New Member
Joined
Jul 26, 2023
Messages
18
Office Version
  1. 365
Platform
  1. 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

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!
1690399202224.png
1690399219296.png
 
Last edited by a moderator:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Welcome to the Board!

I don't think you can have a multi-cell range in that argument.

Does this work?
VBA Code:
.Item.To = ThisWorkbook.Sheets("ReporteFinal").Range("O3").Value & "," & ThisWorkbook.Sheets("ReporteFinal").Range("O4").Value
 
Upvote 0
Solution
Welcome to the Board!

I don't think you can have a multi-cell range in that argument.

Does this work?
VBA Code:
.Item.To = ThisWorkbook.Sheets("ReporteFinal").Range("O3").Value & "," & ThisWorkbook.Sheets("ReporteFinal").Range("O4").Value
Yes it is, but in the final "with" funtion now appears the run time error 91, do you know what it means and how to fix it please?
1690401789728.png
1690401817723.png
 
Upvote 0
OK, I don't know then.
Sorry, I don't think I am able to help you with that error.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top