+ Reply to Thread
Results 1 to 5 of 5

Copy 2 Sheets in Workbook Attach to Email

  1. #1
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    546

    Copy 2 Sheets in Workbook Attach to Email

    Looking for help as I am getting errors with this one. I want to take two sheets that are in a giant workbook and take a copy of them and attach them to an email. Each month I have to attach these sheets.
    I would like to copy them as they are, meaning no values, One sheet contains a pivot table and the other summarizes the data. I used this code but it doesnt work.

    I am getting an error on this line:
    Set OutApp = CreateObject("Outlook.Application")

    Run-time error '429'
    ActiveX Component Cant create object.

    If you require additional information please ask.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by wherdzik; 10-12-2023 at 06:53 PM.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: Copy 2 Sheets in Workbook Attach to Email

    Could it be that MS Outlook is not installed on the computer?

    Artik

  3. #3
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    546

    Re: Copy 2 Sheets in Workbook Attach to Email

    It is installed, I have used other code with outlook and no issues.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: Copy 2 Sheets in Workbook Attach to Email

    It's a little strange, because the presented code looks correct.
    See if the following code change makes a difference.

    Instead of line:
    Please Login or Register  to view this content.
    type:
    Please Login or Register  to view this content.
    and additionally function:
    Please Login or Register  to view this content.
    Artik

  5. #5
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    546

    Re: Copy 2 Sheets in Workbook Attach to Email

    Artik, I found the issue. My organization was blocking the vba code because of security concerns. I saw in Windows event viewer that this was getting stopped repeatedly.
    So you are correct the code is probably fine I just need to have IT fix this.

    Thank you.

+ 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. [SOLVED] Email and attach a range for specific sheets
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-31-2022, 11:41 AM
  2. [SOLVED] Copy Activesheet and Other Sheets to Temporary Workbook and Attach to Email
    By v.rodgers in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-03-2015, 05:50 AM
  3. Attach just one sheet of a workbook to an email
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2014, 10:17 AM
  4. Save workbook, attach it to outlook email, close workbook?
    By Jasonhouse in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-27-2014, 11:52 PM
  5. Replies: 1
    Last Post: 03-11-2014, 12:44 PM
  6. Launch email and attach open workbook to email?
    By mlefkowitz in forum Excel General
    Replies: 0
    Last Post: 09-11-2012, 02:01 PM
  7. Email workbook AND attach a separate file to the email
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2009, 06:48 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