ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using variable in subject when send mail (https://www.excelbanter.com/excel-programming/428867-using-variable-subject-when-send-mail.html)

alvin Kuiper

using variable in subject when send mail
 
Hi
I have this
With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr, _
FileFormat:=FileFormatNum
'On Error Resume Next
.SendMail ", _
"hej"
On Error GoTo 0
.Close SaveChanges:=False
End With
But if i use this:
..SendMail ", _
"hej" & variable

I get an error ?

Alvin



Jacob Skaria

using variable in subject when send mail
 
Dear Alvin

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

Dim strSubject As String
strSubject = "Test Email"

ActiveWorkbook.SendMail ", _
Subject:=strSubject

If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

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

I get an error ?

Alvin



alvin Kuiper

using variable in subject when send mail
 
Yes yes yes
Thanks
alvin


"Jacob Skaria" skrev:

Dear Alvin

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

Dim strSubject As String
strSubject = "Test Email"

ActiveWorkbook.SendMail ", _
Subject:=strSubject

If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

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

I get an error ?

Alvin




All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com