Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
#20923
Bom dia,
estou com problemas nesse código, o endereço e o título estão saindo da forma esperada, mas o corpo do email não, alguém me ajuda? Obrigado desde já
Código: Selecionar todos
Private Sub Worksheet_Change(ByVal Target As Range)
    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 = "$W$" & linha Then
End If
        If Plan1.Cells(linha, 24) = "X" Then
            texto = "Prezado " & Plan1.Cells(linha, 13) & "," & vbCrLf & vbCrLf & _
                    "Segue reclamação referente ao bairro " & Plan1.Cells(linha, 4) & " aberta em " & _
                    Plan1.Cells(linha, 7) & " com prazo de " & _
                    Plan1.Cells(linha, 16) & vbCrLf & vbCrLf & _
                    "    Mutuário: " & Plan1.Cells(linha, 9) & vbCrLf & _
                    "    Endereço: " & Plan1.Cells(linha, 10) & vbCrLf & _
                    "    Telefone: " & Plan1.Cells(linha, 11) & vbCrLf & _
                    "    Reclamação: " & Plan1.Cells(linha, 6) & vbCrLf & _
                    "    Bairro: " & Plan1.Cells(linha, 4) & vbCrLf & vbCrLf & _
                    "Atenciosamente," & vbCrLf & _
                    "Help Desk"
        
        End If
        
                    
        With OutMail
            .To = Plan1.Cells(linha, 25)
            .CC = ""
            .BCC = ""
            .Subject = "Reclamação " & Plan1.Cells(linha, 4)
            .Body = texto
            .Display   'Utilize Send para enviar o email sem abrir o Outlook
        End With
        On Error GoTo 0

        Set OutMail = Nothing
        Set OutApp = Nothing
    End If
End Sub


#20929
Bom dia!

Vou aproveitar o tópico pois minha dúvida é pertinente a sua.
Tenho um código exatamente igual, e sempre funcionou com o Windows 7.
Com um upgrade para o Windows 8, o programa debuga na etapa de envio:

Imagem

O Plan4.Cells(linha, 19) está correto, na 19ª coluna estão os e-mails para quem deve ser enviado.

Se eu altero o .To = Plan4.Cells(linha, 19) para um endereço de e-mail fixo, obtenho sucesso no envio.
EX: .To = "teste@gmail.com"

Alguém sabe como resolvo este problema?

Agradeço desde já!
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord