Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    email excel workbook (Excel 2003)

    I'm trying to create a Macro to email the active workbook as an attachment to a specified address. I've been using the Sendmail command but I can't seem to make this work. Any advice?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: email excel workbook (Excel 2003)

    Welcome to Woody's Lounge!

    You can use an instruction like the following to send the active workbook to you@somewhere.com:

    ActiveWorkbook.SendMail "you@somewhere.com", "Test send workbook"

    However, if you're using Outlook as e-mail client, you'll be asked whether you want to allow a program to send e-mail on behalf of you; you have to wait for 10 seconds before you can click Yes. If you need to do this often, it becomes annoying. There's a free utility ClickYes that, as the name indicates, clicks Yes for you.

  3. #3
    New Lounger
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: email excel workbook (Excel 2003)

    I tried your code but when I try to run from the VB editor I get a the following message: Run-time error '1004' application-defined or object-defined error. If I try to run the Macro from the worksheet it gives me an error msg box that simply says: 400

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: email excel workbook (Excel 2003)

    Can you send the workbook interactively, using File | Send To | Mail Recipient (as attachment), or does that fail too?

  5. #5
    New Lounger
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: email excel workbook (Excel 2003)

    We don't use Outlook here so that feature is disabled. We use Lotus (Not that I'm a fan) but I need this to with a number of email clients as I am creating a form and will be sharing this across the state.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: email excel workbook (Excel 2003)

    Have you made sure that Lotus Notes has been specified as the default e-mail client in the Programs tab of Tools | Internet Options in Internet Explorer?

  7. #7
    New Lounger
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: email excel workbook (Excel 2003)

    Yup. I've made sure of that. Is it possible that the cause of this is that we've never even installed outlook on this machine? Perhaps there are some necessary dll files missing?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: email excel workbook (Excel 2003)

    I'm not sure what is required, I've never used Lotus Notes.

    Perhaps you can use the code in VB and VBA - Lotus Notes Send Email from VB or VBA.

  9. #9
    New Lounger
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: email excel workbook (Excel 2003)

    OK. Thanks for all your help Hans.

Posting Permissions

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