Send pay slips to different employee email ids automatically through outlook (1 Viewer)

surya

New member
Local time
Tomorrow, 00:18
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:48
Joined
Oct 29, 2018
Messages
21,474
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:

Gasman

Enthusiastic Amateur
Local time
Today, 19:48
Joined
Sep 21, 2011
Messages
14,310
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

Top Bottom