Consulting

Results 1 to 5 of 5

Thread: Outlook Vba code doesn't work when I restart my machine.

  1. #1
    VBAX Contributor
    Joined
    Nov 2014
    Posts
    121
    Location

    Post Outlook Vba code doesn't work when I restart my machine.

    Hi Experts,

    I have a VBA code saved in ThisOutlookSession. Whenever I restart or start the outlook app it doesn't work. Am I doing something wrong with it. I want it to run when the app gets start.

    Regards,
    JD

  2. #2
    It probably relates to security issues.

    In the Office folder you will find selfcert.exe which will enable you to create a certificate for your own macros.

    Having done that, set the macro security in Outlook to provide warnings for all macros, then start the VBA editor and from Tools > Digital Signatures, add your newly created signature to the project.

    Close Outlook saving the project at the warning.

    Re-open Outlook and you will get a security prompt for the vbaproject. From that dialog choose the option to trust items from the publisher (your certificate).

    Thereafter the macros should work normally without prompts.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Contributor
    Joined
    Nov 2014
    Posts
    121
    Location
    Hi Gmayor
    I followed the above steps and created Digital certificate, but after I restart the macrosoft outlook 2010 it throws the attached message and the macro doesn’t work.
    Please let me know what I am doing wrong here.
    Regards,
    JD
    Attached Images Attached Images

  4. #4
    VBAX Contributor
    Joined
    Nov 2014
    Posts
    121
    Location
    Hi Gmayor

    I am using "Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)" in ThisOutlookSession do I have to add any reference to it.

    Regards,
    JD

  5. #5
    VBAX Contributor
    Joined
    Nov 2014
    Posts
    121
    Location
    Hi Gmayor

    I tried the entire process again today and it worked. Thanks for your help on this.

    Regards,
    JD

Tags for this Thread

Posting Permissions

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