How to accept with code the next pop up "a program is trying to send an email message on your behalf"

MiyagiZama

New Member
Joined
Jul 26, 2023
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hello mates, I have a question for my code, due to the next pop up appears when I tried to send an email, I saw in a thread in this blog with the same issue but, unfortunately in my company exist a lot of boundaries for Cibber security and I cant to press the send bottom in my macro without pop up appears

I used MailEnvelope atribute


Could you assist to me please how can I can fix this


Here's the VBA code

VBA Code:
Sub ENVIACORREOSCHNEIDERUSA()
'
'DECLARAMOS VARIABLES
'
Dim Destinatarios As String
Dim shSCHNEIDERUSA As Worksheet
'
'
Set shSCHNEIDERUSA = Sheets("SCHNEIDER ELECTRIC USA")
'
'AJUSTAMOS LA PRIMERA COLUMNA A LA IZQ PARA QUE EL TEXTO DEL CORREO SALGA ALINEADO A LO QUE QUEREMOS ENVIAR
 '
     shSCHNEIDERUSA.Activate
     
     Columns("A:A").Select
    With Selection
        .HorizontalAlignment = xlLeft
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
     
 '
'AUMENTAMOS 10 ROWS O FILAS EN LA HOJA DONDE ESTA LA TABLA FINAL Y ACTIVAMOS LA HOJA
'
'
  ActiveSheet.Rows("1:12").Insert
'
'
'ESCRIBIMOS NUESTRO MENSAJE EN LAS CELDAS QUE AÑADIMOS YA QUE EL MAIL ENVELOPE NO TIENE ATRIBUTOS PARA CAMBIAR TAMAÑO O COLOR DE FONT
'POSTERIORMENTE LE AUMENTAMOS EL TAMAÑO Y PONEMOS EN NEGRITAS EL TEXTO QUE DESEAMOS
  '
  Range("A1").Value = "Apreciables colegas, espero que se encuentren excelente el dia de hoy."
  Range("A3").Value = "El motivo del siguiente correo es para pedir su apoyo con la colocacion de las siguientes Ordenes de Compra "
  Range("A5").Value = " Quedamos al pendiente de su futura respuesta "
  Range("A10").Value = "Atentmente"
  Range("A11").Value = "Departamento de Compras"
  Range("A1:A10").Font.Size = 16
  Range("A10").Font.Bold = True
'
'
'LLAMAMOS AL ENVIO

  ActiveWorkbook.EnvelopeVisible = True
  With ActiveSheet.MailEnvelope
    .Item.To = "alejandra.flores1@se.com"
    .Item.Subject = "Odenes de Compra Schneider Electric Monterrey 1"
    .Item.Send
  End With
    '
      '
'BORRAR LAS FILAS QUE AÑADIMOS Y LAS COLUMNAS DE LA TABLA QUE ENVIAMOS POR CORREO
  shSCHNEIDERUSA.Columns("A:G").Delete
    ActiveWorkbook.EnvelopeVisible = False

End Sub
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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