+ Reply to Thread
Results 1 to 7 of 7

Modification required in attaching excel sheet in to an email

  1. #1
    Spammer
    Join Date
    06-27-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    183

    Modification required in attaching excel sheet in to an email

    Hi Friends,

    I am using the below VBA code to copy my excel sheet to attach in the outlook mail to send to an e mail id.

    My problem is if any of the or non of the sheet is available in the workbook then the macro get's stopped.

    Kindly help me with the modification to run the macro if a single sheet or entire sheet is not in the workbook also it should run and move to another command.
    --------------------
    Please Login or Register  to view this content.
    --------------------

    Regards,

    Prabhu
    Last edited by [email protected]; 11-01-2013 at 05:27 AM.

  2. #2
    Registered User
    Join Date
    04-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    80

    Re: Modification required in attaching excel sheet in to an email

    Hi,

    I think you should start by creating an array containing existing sheets in the workbook first and build on to your script from there. Try to integrate this in to your code:

    Please Login or Register  to view this content.
    Hope this helps
    Draconi

  3. #3
    Spammer
    Join Date
    06-27-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    183

    Re: Modification required in attaching excel sheet in to an email

    Hi Draconi ,

    I could not complete, can you help me with complete VBA code for the above requirement.

  4. #4
    Registered User
    Join Date
    04-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    80

    Re: Modification required in attaching excel sheet in to an email

    Post a copy of your spreadsheet and I can take a look.

  5. #5
    Spammer
    Join Date
    06-27-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    183

    Re: Modification required in attaching excel sheet in to an email

    Hi Draconi,

    Plz find the workbook for your reference.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    80

    Re: Modification required in attaching excel sheet in to an email

    Hi prabhubox,

    I'm assuming that each sheet in the workbook you've posted is representing individual companies. I was going through your script and noticed that you may have been trying to send an email to companies who's data actually exists in the workbook. Here is what I've come up with. Let me know if it's in tune with what you're looking for.

    Note:

    The Script works as follows:
    1) Generates a list of all sheet names and e-mail addresses located in Cell A1 of each sheet in to "UniqueList"
    2) Checks for Sheets that have not been named and are still default of "Sheetx". It then asks you to correct the name or delete the sheet
    3) It prompts you to send an email to each company whose sheet actually exists in the workbook.
    4) If you've answered yes to Step 3, it will create attachments of each sheet in individual e-mails destined for their respective recipients.
    Attached Files Attached Files

  7. #7
    Spammer
    Join Date
    06-27-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    183

    Re: Modification required in attaching excel sheet in to an email

    Hi Draconi,

    Thanks for your time.

    Actually it is part of my macro, my actual purpose is that i have a data which has customer wise details (A column is Customer Code) and it needs to send this the customers Email id from the base date sheet.

    Even i never mind if we send the data from the base sheet to the customer's assigned mail id's to each customer.

    From the Base data it should go to various customer's mail id by including 2 header column in the each excel sheet.Mail id details to be assigned in the VBA code.

    I have attached the base data for your reference.

    Kindly do the needful.

    Prabhu
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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