+ Reply to Thread
Results 1 to 10 of 10

Macro to send Excel sheet as outlook attachmnt just started failing

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    33

    Macro to send Excel sheet as outlook attachmnt just started failing

    For some reason unknown to me (VBA newbie) a macro that I have been using for a couple years now returns a "Code Execution has been interrupted" error. when I debug it it stops at the 'Set Lworkbook=Activeworkbook' code line.

    I'm using Excel and Outlook 2013 versions

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,048

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    It works fine for me in Excel 2013.
    Is it possible your workbook is protected?
    Last edited by mikeTRON; 05-05-2016 at 12:41 PM.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    That's odd. Yes my workbook is protected but it breaks before even getting to that point.

    I even created a new excel file and the macro still fails at the same point
    Please Login or Register  to view this content.
    .
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,048

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    Yeah I copied and pasted your exact code into a new workbook and it worked flawlessly.

    Activeworkbook is somewhat ambiguous though, as I wouldn't recommend using it. I would suggest trying to explicitly defining LWORKBOOK instead and see if that helps.

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    Well apparently it is something specific to my excel only. I just tried it from a co-worker's pc and it worked fine. Any ideas what in excel settings may be causing it. I don't recall making any changes to settings

  6. #6
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,048

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    Anytime I have issues like this I juts wash my laptop in the dishwasher and let IT figure it out. :D

    Seriously, I have NO idea why your's would bomb and your coworker's wouldn't. Maybe check and see if you have any windows updates. Then you can also try seeing if you have any ADD-INs installed that your coworker doesn't.

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    The problem I would have with specifying the workbook name is that it changes with every use based on the network folder it is saved in.

    I have my excel configured exactly the same as the other pc I tested it on and no luck. Looks like a reinstall of excel may be in order

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 2016
    Posts
    4,907

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    Sorry for the obvious question... but you have rebooted since you had the issue?
    You can specify the workbook in other ways that just name or ActiveWorkbook... for example "ThisWorkbook" would be the one containing the code, which is still more explicit than activeworkbook.

    ie:
    Please Login or Register  to view this content.
    I know that particular application does nothing for this case... just realized it is your new workbook...
    Last edited by Arkadi; 05-05-2016 at 03:22 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  9. #9
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    With MS not sure anything is obvious but yes I have restarted since this problem started. I just uninstalled and reinstalled excel and the issue now moves past that point and breaks at
    Please Login or Register  to view this content.
    . If i try to continue It will actually complete as expected so maybe I'm getting closer.

    It doesn't help that since I'm pretty new to this I don't fully understand what each line actually means

    I went ahead and made your recommended change as well.

  10. #10
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Macro to send Excel sheet as outlook attachmnt just started failing

    Wanted to update the thread that this issue has been resolved. In addition to the issues above I started receiving the error "VBA Objet Error-Class not registered.Looking for object with CLSID:{AC9F2F90-E877-11CE-9F68-00AA00574A4F}"

    After trying every solution found online, most of which applied to previous versions of excel anyways, I was forced to completely uninstall MS office suite, clean the registry of any remnants and reinstall office. So far none of the issues have returned.

    Thanks for all the help.

+ 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. Macro to send email from Excel sheet through outlook
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2016, 10:16 AM
  2. convert excel sheet to pdf using macro and send that pdf via email using outlook
    By suresh mongam in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-25-2015, 08:51 AM
  3. Outlook send data to active excel sheet
    By zplugger in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2015, 06:59 AM
  4. [SOLVED] Excel to Word macro fails when started from another sheet
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2015, 03:40 AM
  5. Send a outlook email through the excel sheet
    By krishnakuma6 in forum Excel General
    Replies: 9
    Last Post: 01-12-2015, 03:58 PM
  6. [SOLVED] Macro to send an excel sheet via outlook
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2012, 05:40 AM
  7. Replies: 1
    Last Post: 10-03-2012, 07:31 AM

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