syed_iqbal
01-19-2017, 06:05 PM
Hi,
First of all, Sorry for my bad english.
With my basic knowledge I created vba code for sending auto mails. But in the code first if condition is not executing. i tried in different ways. but all are went in vain. Pls help me.
Criteria:
1) if employee status is "Resigned" ("Status" column mentioned in "Master" sheet) then mail should not go to that person.
2) if employee status is "Working" and there is no individual attachment for him, then mail should go with remaining all attachments (attachment file path's are mentioned in 'column F' in "Emp Information" Sheet).
3) if employee status is "Working" and there is individual attachment, then mail should go with remaining all attachments (attachment file paths mentioned in each individual cell in 'Column F' in "Emp Information" sheet) including individual attachment (attachment file path mentioned in each individual cell in 'Column F' in "Emp Information" sheet).
Example:
1)Employee's A1,A5,A9,A10,A15 are resigned. So they should not get email.
2) Employee A3 is Working and there is no file to attach for them (Column F in "Emp information" sheet). then Mail should go with remaining all attachments in column G in "Emp information" Sheet ("Covering letter.txt","1.txt")
3) for employees A2,A4,A6,A7,A8,A9,A11,A13,A14 , mail should go with all attachments (individual & remaining files)
I hope criteria's are clear.
Code is perfect except one error. if there are more than one resigned employees (A9 and A10 employees details are in a row in "Emp information" Sheet. They both are resigned. ) details came one by one, then error occurs.
i can't understand where the mistake was occurred in my code. Pls help me
Thank you in advance
First of all, Sorry for my bad english.
With my basic knowledge I created vba code for sending auto mails. But in the code first if condition is not executing. i tried in different ways. but all are went in vain. Pls help me.
Criteria:
1) if employee status is "Resigned" ("Status" column mentioned in "Master" sheet) then mail should not go to that person.
2) if employee status is "Working" and there is no individual attachment for him, then mail should go with remaining all attachments (attachment file path's are mentioned in 'column F' in "Emp Information" Sheet).
3) if employee status is "Working" and there is individual attachment, then mail should go with remaining all attachments (attachment file paths mentioned in each individual cell in 'Column F' in "Emp Information" sheet) including individual attachment (attachment file path mentioned in each individual cell in 'Column F' in "Emp Information" sheet).
Example:
1)Employee's A1,A5,A9,A10,A15 are resigned. So they should not get email.
2) Employee A3 is Working and there is no file to attach for them (Column F in "Emp information" sheet). then Mail should go with remaining all attachments in column G in "Emp information" Sheet ("Covering letter.txt","1.txt")
3) for employees A2,A4,A6,A7,A8,A9,A11,A13,A14 , mail should go with all attachments (individual & remaining files)
I hope criteria's are clear.
Code is perfect except one error. if there are more than one resigned employees (A9 and A10 employees details are in a row in "Emp information" Sheet. They both are resigned. ) details came one by one, then error occurs.
i can't understand where the mistake was occurred in my code. Pls help me
Thank you in advance