Send pay slips to different employee email ids automatically through outlook

surya

New member
Local time
Today, 20:15
Joined
Nov 14, 2023
Messages
1
Hi,

1. I have entered the below VBA code in excel, which creates PDF files (i.e., employees payslips from excel sheet) in a folder based on the datalist in the range.

Sub Iterate_Through_data_Validation()
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Set xRg = Worksheets("Sheet2").Range("D8")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
For Each xCell In xRgVList
xRg = xCell.Value
ActiveSheet.PrintOut
Next
End Sub

2. Please let me know the code in VBA excel to send the pdf files i.e., pay slips to different employee email ids automatically through outlook integrating the above code.
 
Hi @surya. Welcome to AWF!

I don't have the code for you, but that's definitely possible. I am just concerned that you need to test it extensively to make sure cross-emails don't happen.

Cheers!
 
Last edited:
Hi,

1. I have entered the below VBA code in excel, which creates PDF files (i.e., employees payslips from excel sheet) in a folder based on the datalist in the range.

Sub Iterate_Through_data_Validation()
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Set xRg = Worksheets("Sheet2").Range("D8")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
For Each xCell In xRgVList
xRg = xCell.Value
ActiveSheet.PrintOut
Next
End Sub

2. Please let me know the code in VBA excel to send the pdf files i.e., pay slips to different employee email ids automatically through outlook integrating the above code.
Plenty of example here. Perhaps use the search function.
Pdfs by email.
 

Users who are viewing this thread

Back
Top Bottom