Olá, testei esse outro código, também funciona, só gostaria que você se possível colocar a função pra enviar a planilha ativa...
Pode ser?
Obrigado!
o código do botão:
Dim oSmtp As New EASendMailObjLib.Mail
Let oSmtp.LicenseCode = "TryIt"
' Set your Gmail email address
Let oSmtp.FromAddr = "meuemail@gmail.com"
' Add recipient email address
oSmtp.AddRecipientEx "meuemail@gmail.com", 0
' Set email subject
Let oSmtp.Subject = "Teste de envio de email através da conta do Gmail."
' Set email body
Let oSmtp.BodyText = "Este é um teste de envio de email através do Gmail."
' Gmail SMTP server address
Let oSmtp.ServerAddr = "smtp.gmail.com"
' If you want to use direct SSL 465 port,
' Please add this line, otherwise TLS will be used.
Let oSmtp.ServerPort = 465
' detect SSL/TLS automatically
oSmtp.SSL_init
' Gmail user authentication should use your
' Gmail email address as the user name.
' For example: your email is "meuemail@gmail.com", then the user should be "meuemail@gmail.com"
Let oSmtp.UserName = "meuemail@gmail.com"
Let oSmtp.Password = "senhadoemail"
MsgBox "Início do envio de e-mails"
If oSmtp.SendMail() = 0 Then
MsgBox "Email foi enviado com sucesso!"
Else
MsgBox "Falha ao enviar email, erro detectado. Erro nº: " & oSmtp.GetLastErrDescription()
End If
End Sub