+ Reply to Thread
Results 1 to 18 of 18

Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Outlook

  1. #1
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Outlook

    Hello People,

    Please i need urgent assistance with the above subject problem.

    We currently do not have a payroll software (one is being purchased soon) but i need to send payslips to over 500 recipients via email.

    This is usually done manually and upon request but some form of legislation makes it compulsory to send to every staff same day they are paid.

    Please assist urgently.

    Thank you.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Welcome to the Forum Akintomiwa!

    What do you have to start with? Do you have these payslips set up in Excel already and you just need to figure out how to email them? When you say you do them manually, what is that process?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Hello 6StringJazzer,

    Thank you for your response.

    I have it all set up, Pay slips are generated directly from the payroll but i haven't figured how to send them to the email addresses all at once.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Where are the email addresses? It would be much faster if you provide a sample of what you have. Remove or change private data. With the information you are providing I can only give very general suggestions. If I have something concrete I can help you with an actual solution. What is your level of expertise with VBA?

    The paper clip icon does not work for attachments. To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

  5. #5
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    I put my email address at the end of the table in the 2nd sheet. As regards my expertise in VBA, i'm a rookie. I just started learning in bits.

    A sample file has been attached, thanx for your offer to assist.
    Attached Files Attached Files

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    I can do this for you, I have something similar for my own company. What format do you want the payslips to be sent?

    - Text in the body of the email
    - Excel file attachment
    - PDF file attachment

    Also, when you enter data into an Excel sheet, you do not need to put ' in front of the data, unless it is a number that you want to force to be text. If it is text, Excel will treat it as text. For example,

    instead of

    '[email protected]

    use

    [email protected]
    Last edited by 6StringJazzer; 11-08-2018 at 12:10 PM.

  7. #7
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    PDF please.

    I don't think i put the apostrophe you saw in the file but your point is duly noted. Thank you very much.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    This solution will generate PDF files for all the payslips and put them in a folder called Payslips that is a subfolder to wherever you save the Excel file. It will give you the option to generate PDF files and mail them, or just generate the files.

    It will mail them using Outlook. It will give you the option to just create the emails, which will be displayed on your screen and you have to click Send, or send the emails immediately.

    Even with just a little VBA knowledge you should be able to update the text that goes in the email pretty easily.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Wow, thank you very much. You just saved my team and I 24 man hours of work.

    I need to learn how to do this, can you give me some pointers please?

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    I was able to do this for you in a fairly short time because I had adapted something I had already done that was very close.

    I can answer specific questions about the code, but I have been using VBA for over 10 years, and I was a professional software developer before I went into management. So I can't teach you what I did in a forum post. It would take me hours. But I can answer questions.

  11. #11
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Oh yeah. I'll come back to you when I have questions.

    Your assistance is highly appreciated.

    Thank you.

  12. #12
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Hello 6StringJazzer,

    I added a few more payroll items in the payroll sheet, meaning more columns. The solution is no longer working.

    I keep on getting the error message:

    Run-time error '-2147467259 (8000405)':
    Outlook does not recognize one or more answers.

    What can i do to correct this?

    Thank you.

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Where did you add columns, in the middle of existing columns, or at the end? The code depends on expecting certain data to be in certain columns, and if you inserted columns in the middle, the data is no longer in the columns where expected.

    The code builds the email address by taking the name from column B and the email address from column BO to create a string

    Firstname Lastname <[email protected]>

    If that data is no longer in the same columns, you will get an illegal email address. I'll bet you copied the error message wrong and it is probably "Outlook does not recognize one or more names."

    If the columns changed you need to update this part of the code:
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    11-07-2018
    Location
    Lagos, Nigeria
    MS-Off Ver
    2016
    Posts
    9

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Perfect, the code has been updated accordingly and works perfectly, thank you. You got the error message correct too.

    If i want to change the body of the mail to read thus,

    Dear XXXX,

    Please see attached your payslip for October 2018.

    Regards,

    How do i go about it?

  15. #15
    Registered User
    Join Date
    06-28-2020
    Location
    TW
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    I just wanna say thank you to 6StringJazzer.
    I was exactly looking for something like this code. I hope figure it out when I change the data , and payslip to my version.
    If iI face some problem can I ask from you ?

    Thanks

  16. #16
    Registered User
    Join Date
    07-30-2020
    Location
    Viet Nam
    MS-Off Ver
    2016
    Posts
    2

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Dear 6StringJazzer,
    I use your code to write my payroll. I'm having a loop error like below. I have attached the file, can you please check it for me?

    formProgress.Label1 = ""
    formProgress.Show //// It's a loop here, and not run the next step if you don't close it.
    Application.ScreenUpdating = False

    Capture.PNG
    Attached Files Attached Files

  17. #17
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Generating PDF Payslips form Payroll in Excel and sending to Individual e-mails in Out

    Quote Originally Posted by huyenkim10116 View Post
    Dear 6StringJazzer,
    I use your code to write my payroll.
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

  18. #18
    Registered User
    Join Date
    08-27-2021
    Location
    Lagos
    MS-Off Ver
    2013
    Posts
    1
    Quote Originally Posted by 6StringJazzer View Post
    I was able to do this for you in a fairly short time because I had adapted something I had already done that was very close.

    I can answer specific questions about the code, but I have been using VBA for over 10 years, and I was a professional software developer before I went into management. So I can't teach you what I did in a forum post. It would take me hours. But I can answer questions.

    Thank you so much for this🙏. I have the same difficulty, and I've searched online for results but to no avail.. this has helped me a great deal.
    And to think this question was answered 4 years ago😄 thanks Akintomiwa

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sending Individual Worksheet via Email (Outlook) with Required Cells
    By JCRoessler14 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-24-2016, 01:40 PM
  2. How to automate payslips from excel based payroll
    By Ibrahim Jinadu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2015, 04:25 PM
  3. Sending e-mails based on tiered rules from Excel via Outlook
    By FlaideyGhand in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-11-2015, 11:52 AM
  4. sending mails from excel
    By young_robot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-26-2014, 05:37 PM
  5. Replies: 1
    Last Post: 06-30-2013, 10:55 AM
  6. Conversion of macro code for sending mails from outlook to lotus notes
    By praveen2825 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 08:48 AM
  7. Replies: 7
    Last Post: 08-11-2012, 02:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1