using variable in subject when send mail

A

alvin Kuiper

Hi
I have this
With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr, _
FileFormat:=FileFormatNum
'On Error Resume Next
.SendMail "[email protected]", _
"hej"
On Error GoTo 0
.Close SaveChanges:=False
End With
But if i use this:
..SendMail "[email protected]", _
"hej" & variable

I get an error ?

Alvin
 
J

Jacob Skaria

Dear Alvin

Use .SendMail Subject:= .........like below

Dim strSubject As String
strSubject = "Test Email"

ActiveWorkbook.SendMail Recipients:="[email protected]", _
Subject:=strSubject

If this post helps click Yes
 
A

alvin Kuiper

Yes yes yes
Thanks
alvin


"Jacob Skaria" skrev:
Dear Alvin

Use .SendMail Subject:= .........like below

Dim strSubject As String
strSubject = "Test Email"

ActiveWorkbook.SendMail Recipients:="[email protected]", _
Subject:=strSubject

If this post helps click Yes
 
Top