Consulting

Results 1 to 7 of 7

Thread: Solved: Turning Off Email safety in VBA?

  1. #1

    Solved: Turning Off Email safety in VBA?

    Hi All

    Im using the following code to email a workbook to a select group if recipients.
    The problem is that when i run the macro Microsift pops up with a message saying the following:
    "A Program is trying to send an e-mail message on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date.

    For more information about e-mail safety and how you might be able to avoid getting this warning, click help"

    Ive clicked on help but it opens the basic help with no suggestions.
    Please help!!!!!!

    [VBA]Sub Email()


    Dim vtPath$
    Dim vtSource$
    Dim vtTarget$



    '' Set up the source path
    vtPath = ThisWorkbook.Path & "\Stats\"

    '' Set up the target and source names
    vtSource = vtPath & ctDb & ".xls"
    vtTarget = vtPath & Format(Now, "ddhhmmss") & ".xls"


    Sheets("Agent Summary").Select
    Sheets("Agent Summary").Copy
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Range("A2").Select
    Application.CutCopyMode = False

    Application.DisplayAlerts = False

    ActiveWorkbook.SaveAs Filename:= _
    vtTarget _
    , FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False, AccessMode:=xlNoChange, ConflictResolution:=Yes


    Application.DisplayAlerts = False
    ActiveWorkbook.SendMail ActiveSheet.Range("A48:A62").Value


    End Sub
    [/VBA]

  2. #2
    Check out www.rondebruin.nl for emailing options from Excel, including ways to handle security.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    That website is excellent, but doesnt solve my problem in any way...
    1. im not using temporary files.
    2. Im looking for a solution to just stop that error message from showing.
    3. Microsofts website is no help.
    4. Suggstions of changing the trust centre also dont work...

    Anybody that can proide answers to this please....

  4. #4
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  5. #5
    I have, i even browsed the Outlook 2007 (great change)http://msdn2.microsoft.com/en-us/library/ms778202.aspx section and it didnt have the answer to taking away the security box. Im lost here, im trying to play with a bit of code from that website to see if i cant come up with something...

  6. #6
    So what Outlook version are you targetting with your code?
    Did you try the redemption route? Works fine in my experience.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  7. #7
    Hi Jan

    Funny that, i just downloaded redemption and it solves my problems...
    you have been a great help...

    Thanks
    Nova

Posting Permissions

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