Dears,
I need your help to solve this issue..I´m trying to send e-mails behalf VBA, but the excel is returning with an error message (Run Time error, 424. Objetive required). Below you can find the macro,
Sub Emailsférias()
Dim OutApp As Object
Dim OutMail As Object
Dim texto As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
linha = ActiveCell.Row - 1
If target.Address = "$R$" & linha Then
If Sheet1.Cells(linha, 18) = "Falta Aprovação" Then
texto = "Prezado(a) " & Sheet1.Cells(linha, 4) & "," & vbCrLf & vbCrLf & _
"Identificamos que suas férias já foram lançadas, mas até o momento não houve aprovação. Pedimos" & vbCrLf & _
"gentilmente que verifique as informações abaixo a fim de obter a aprovação do seu Gestor dentro do" & vbCrLf & _
"prazo estipulado correto." & vbCrLf & vbCrLf & _
"Saldo de férias: " & Sheet1.Cells(linha, 10) & vbCrLf & vbCrLf & _
"Período de gozo: " & Sheet1.Cells(linha, 14) & " a " & Sheet1.Cells(linha, 14) & "," & vbCrLf & vbCrLf & _
"Data limite aprovação: " & Sheet1.Cells(linha, 11) & vbCrLf & vbCrLf & _
"Link do Portal RH - http://portalrh.chevron.com/forms/frmservlet?config=portalrh" & vbCrLf & vbCrLf & _
"Obs: Férias não aprovadas dentro do prazo poderão ser canceladas" & vbCrLf & vbCrLf & _
"Atenciosamente," & vbCrLf & vbCrLf & _
"HR Employee Relations"
End If
With OutMail
.To = Sheet1.Cells(linha, 3)
.CC = "[email protected]"
.BCC = ""
.Subject = "Férias Pendentes de aprovação"
.Body = texto
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub
Please, help me! tks in advance,
Neivaldo
Bookmarks