Hi ALL Experts
Can anyone help me macros to auto send email with attached the XLS file when the excel file click close to target a person ?
Thanks
I used 2003
Hi ALL Experts
Can anyone help me macros to auto send email with attached the XLS file when the excel file click close to target a person ?
Thanks
I used 2003
adapted from ron debruin code
[vba]
Sub Mail_workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook
If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will be no VBA code in the file you send." & vbNewLine & _
"Save the file first as xlsm and then try the macro again.", vbInformation
Exit Sub
End If
End If
On Error ResumeNext
wb.SendMail "ron@debruin.nl", _
"This is the Subject line"
On Error GoTo 0
End Sub[/vba]
Last edited by Aussiebear; 07-08-2010 at 02:18 AM. Reason: Edited post to suit page
thanks the help, but can u send again the code as it was ....and i can't Reorganize...
upps...
[VBA]workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook
If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will be no VBA code in "& _
"the you send." & vbNewLine & _
"Save the file first as xlsm and then try the macro again.", vbInformation
Exit Sub
End If
End If
On Error Resume Next
wb.SendMail "ron@debruin.nl", _
"This is the Subject line"
On Error GoTo 0
End Sub[/VBA]
Book1.xlsm[vba]workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook
If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will be no VBA code in "& _
"the you send." & vbNewLine & _
"Save the file first as xlsm and then try the macro again.", vbInformation
Exit Sub
End If
End If
On Error Resume Next
wb.SendMail "ron@debruin.nl", _
"This is the Subject line"
On Error GoTo 0
End Sub[/vba][/quote]
Is it possible as below?
Sheet1 is the contact list as below
a 11111@qq.com
b 11112@qq.com
c 11113@qq.com
d 11114@qq.com
then there have 4's sheet, the sheet name as below
a
b
c
d
Can it auto send
sheet "a" to 11111@qq.com as PDF format
sheet "b" to 11112@qq.com as PDF format
sheet "c" to 11113@qq.com as PDF format
sheet "d" to 11114@qq.com as PDF format