+ Reply to Thread
Results 1 to 3 of 3

Email and Excel Problem

Hybrid View

Guest Email and Excel Problem 05-22-2006, 03:35 PM
Guest Re: Email and Excel Problem 05-22-2006, 03:50 PM
Guest Re: Email and Excel Problem 05-22-2006, 03:50 PM
  1. #1
    carl
    Guest

    Email and Excel Problem

    I've been using this code and it has been working great:

    'Sub Mail_ActiveSheet_Body()
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Application.ScreenUpdating = False
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)
    With OutMail
    .To = "abc.com"
    .CC = "efg.com"
    .BCC = ""
    .Subject = Sheets("trading").Range("A9").Value
    .HTMLBody = SheetToHTML(ActiveSheet)
    .Send 'or use .Display

    Now when I run the macro, I get an Outlook message that

    " A program is trying to automatically send e-mail on your behalf. Do you
    want to allow this ?

    The window gives me choices Yes, No, Help.

    If I say yes. the email goes out. If I say no, the vba gets stuck on the
    last line of the code above.

    Is there any way to stop this outlook message - speed is very important in
    my application and this Outlook message really slows things down.

    Thank you in advance.


  2. #2
    Ron de Bruin
    Guest

    Re: Email and Excel Problem

    See
    http://www.rondebruin.nl/mail/prevent.htm



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "carl" <carl@discussions.microsoft.com> wrote in message news:93D68585-5E50-40CF-A732-011D92E954BD@microsoft.com...
    > I've been using this code and it has been working great:
    >
    > 'Sub Mail_ActiveSheet_Body()
    > Dim OutApp As Outlook.Application
    > Dim OutMail As Outlook.MailItem
    > Application.ScreenUpdating = False
    > Set OutApp = CreateObject("Outlook.Application")
    > Set OutMail = OutApp.CreateItem(olMailItem)
    > With OutMail
    > .To = "abc.com"
    > .CC = "efg.com"
    > .BCC = ""
    > .Subject = Sheets("trading").Range("A9").Value
    > .HTMLBody = SheetToHTML(ActiveSheet)
    > .Send 'or use .Display
    >
    > Now when I run the macro, I get an Outlook message that
    >
    > " A program is trying to automatically send e-mail on your behalf. Do you
    > want to allow this ?
    >
    > The window gives me choices Yes, No, Help.
    >
    > If I say yes. the email goes out. If I say no, the vba gets stuck on the
    > last line of the code above.
    >
    > Is there any way to stop this outlook message - speed is very important in
    > my application and this Outlook message really slows things down.
    >
    > Thank you in advance.
    >




  3. #3
    Bob Phillips
    Guest

    Re: Email and Excel Problem

    See http://www.rondebruin.nl/mail/prevent.htm

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "carl" <carl@discussions.microsoft.com> wrote in message
    news:93D68585-5E50-40CF-A732-011D92E954BD@microsoft.com...
    > I've been using this code and it has been working great:
    >
    > 'Sub Mail_ActiveSheet_Body()
    > Dim OutApp As Outlook.Application
    > Dim OutMail As Outlook.MailItem
    > Application.ScreenUpdating = False
    > Set OutApp = CreateObject("Outlook.Application")
    > Set OutMail = OutApp.CreateItem(olMailItem)
    > With OutMail
    > .To = "abc.com"
    > .CC = "efg.com"
    > .BCC = ""
    > .Subject = Sheets("trading").Range("A9").Value
    > .HTMLBody = SheetToHTML(ActiveSheet)
    > .Send 'or use .Display
    >
    > Now when I run the macro, I get an Outlook message that
    >
    > " A program is trying to automatically send e-mail on your behalf. Do you
    > want to allow this ?
    >
    > The window gives me choices Yes, No, Help.
    >
    > If I say yes. the email goes out. If I say no, the vba gets stuck on the
    > last line of the code above.
    >
    > Is there any way to stop this outlook message - speed is very important in
    > my application and this Outlook message really slows things down.
    >
    > Thank you in advance.
    >




+ 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