+ Reply to Thread
Results 1 to 23 of 23

Overwrite "Allow Access For..." Security Message When Running Code on Outlook

  1. #1
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Hi all.

    I was wondering if anyone knows of a way to adapt some existing code - which accesses Outlook messages - so that I do not receive (and therefore have to manually action) the following security message:

    "A program is trying to access e-mail address information stored in Outlook..."

    I then have the option to allow access for up to 10 minutes. The problem is that the folders on which I wish to run the code are very large, and so I would ideally like to leave it running when I'm not present, e.g. overnight.

    Of course, I can't do this if I have to action this message every 10 minutes. Also, I cannot resolve this issue by changing the Trust Center settings as I do not have that privilege.

    Does anyone know how I can tweak the below code to achieve this?

    Many thanks in advance.


    Please Login or Register  to view this content.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    The options I know of are:
    1. Use the Redemption library - you need a licence for commercial use. (it basically handles all the Extended MAPI calls you need)
    2. Use a program like ClickYes.
    3. Use Sendkeys and trust to luck.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Thanks, Rory.

    Can you expand a bit upon the third option? What happens if I'm "unlucky", for example? What sort of probability does experience tell you that I have of being "lucky"?

    And there's no option to run some further code to action this security message in my absence?

    Cheers

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    If you're unlucky the keystrokes won't get sent to the right window. Whether that's bad or not depends on what else might be running!

    If the computer is unattended and untouched, you may be ok - assuming that you don't have some sort of screensaver / power saving feature kicking in, in which case I don't know if anything will work anyway.

    It might be possible to do a slightly more specific version using API calls - I'll have a think. Unfortunately it's tricky for me to test, as my code can run unhindered in Outlook.
    Last edited by romperstomper; 10-21-2014 at 05:52 AM.

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Much appreciated.

    Perhaps I can look into whether I can disable any screen/power saving features and give the Sendkeys option a go this evening.

    Can you let me know what extra code I'd need?

    Regards

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    What exact keystrokes do you have to use when the dialog pops up?

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    ALT+A/TAB/TAB/ENTER

    This will set it to allow access for 1 minute. Guess it doesn't make a difference whether it's for 1 minute or 10?

    Cheers

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    This is proving more problematic than expected! I don't suppose you can use any of these options instead (especially the .reg files): http://www.slipstick.com/developer/c...ccess-options/

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    I've made a request to the administrator to have the appropriate security settings temporarily changed, though I'm not confident that it will be granted.

    Will have a look at these registry options tomorrow.

    As always, your time's much appreciated.

    Cheers

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    No problem. I've had an entertaining afternoon crashing my computer with ill-judged API calls...

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Ah. Apologies, then!

    Still - sounds like I've forced you to learn something new?!

  12. #12
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Yep - my favourite kind of day; I've learned a few new things about Excel today!

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Quote Originally Posted by romperstomper View Post
    This is proving more problematic than expected! I don't suppose you can use any of these options instead (especially the .reg files): http://www.slipstick.com/developer/c...ccess-options/
    It worked! I downloaded the registry file for Outlook 2010 and my Programmatic Access is now set to: Never warn me about suspicious activity.

    Not sure I should've been allowed to do this, but hey!

    Only thing is: how do I change it back again when I'm done? Any ideas/links?

    Cheers

  14. #14
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    In that file (you can open it in Notepad), change the first key to:
    "ObjectModelGuard"=dword:00000000
    and then save it. Then double-click it again. That should reset to the 1st option in the Trust Center.

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Life-saving advice! Cheers!

  16. #16
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    No problem. Good to see your IT people have a good handle on security.

  17. #17
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Indeed! (I'm not complaining!)

  18. #18
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Actually I spoke to soon.

    Running this version:

    Please Login or Register  to view this content.
    changed my Programmatic Access to Never warn me about suspicious activity, though then running this:

    Please Login or Register  to view this content.
    did not change that setting.

    Can you clarify? Do I perhaps need to change the "PromptOOMSend" value as well?

    Regards

  19. #19
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Edit: ignore that.

    Me being thick again. The old reboot did it.

    Certainly not very "Guru"-like thinking!!

  20. #20
    Registered User
    Join Date
    10-22-2014
    Location
    Birmingham UK
    MS-Off Ver
    Various
    Posts
    55

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    I reccomend the clickyes option. I installed this on my automated machine that was emailing reports out every 15 minutes and worked a treat. I'm sure with some googling you can find a free copy of this

  21. #21
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Quote Originally Posted by XOR LX View Post
    Certainly not very "Guru"-like thinking!!


    Congrats by the way.

  22. #22
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Quote Originally Posted by robtuby View Post
    I reccomend the clickyes option. I installed this on my automated machine that was emailing reports out every 15 minutes and worked a treat. I'm sure with some googling you can find a free copy of this
    Ah, ok. Thanks a lot. Will have a look into this as a potential back-up if I need to be doing this sort of thing more often.

    Regards

  23. #23
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Overwrite "Allow Access For..." Security Message When Running Code on Outlook

    Quote Originally Posted by romperstomper View Post


    Congrats by the way.
    Cheers!

+ 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. [SOLVED] Excel 2007 "security alert - data connection" message every time?
    By michael.monaco in forum Excel General
    Replies: 2
    Last Post: 12-20-2012, 02:24 PM
  2. Replies: 0
    Last Post: 11-20-2012, 10:22 AM
  3. [SOLVED] Macro with "save as" --- Need excel to overwrite a file without a prompt to overwrite
    By tsmith1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2012, 10:54 AM
  4. MSoffice Outlook 2003 message to be saved in C dir with the file name "From" "Sent" "Sub"
    By shailendra0509 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2012, 01:32 AM
  5. Excel and Outlook become "NOT RESPONDING" when running Macro
    By g1987 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2012, 03:28 PM

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