Con esta macro puede enviar un rango de datos en pdf, previamente tiene que estar configurado microsoft outlook con el correo del remitente, saludos.
Sub EnvioEmailPDF()
Dim olApp As Object
Dim olMail As Object
Dim RutaTemporal As String
Dim NombreTemporal As String
Dim RutaCompleta As String
Mensaje = MsgBox("Desea enviar por mail el informe?", vbYesNo, "Infromes Nova")
If Mensaje = vbNo Then
Exit Sub
Else
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
RutaTemporal = Environ$("temp") & "\"
NombreTemporal = ActiveSheet.Name & ".pdf"
RutaCompleta = RutaTemporal & NombreTemporal
On Error GoTo Err
On Error Resume Next
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=RutaCompleta, _
quality:=xlQualityStandard, _
includedocproperties:=True, _
ignoreprintareas:=False, _
openafterpublish:=False
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
On Error Resume Next
With olMail
.To = "[email protected];[email protected]"
.CC = "[email protected];[email protected]"
.Subject = "Titulo del Correo"
.Body = "Cuerpo del correo"
.Attachments.Add RutaCompleta
Fila_Final = Range("H" & Cells.Rows.Count).End(xlUp).Row
'Rango a enviar
Range("A1:H" & Fila_Final).Select
ActiveWorkbook.EnvelopeVisible = True
.Send
End With
On Error GoTo 0
On Error Resume Next
Kill RutaCompleta
Set olApp = Nothing
Set olMail = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
ActiveWorkbook.EnvelopeVisible = False
Exit Sub
Err:
MsgBox Err.Description, vbCritical + vbOKOnly, Err.Number
End If
End Sub