Forum Discussion
Another program is trying to access mu outlook data
I have a small app written by myself that accesses the outlook pst file and creates a small window on my desktop with a list of my appointments for the next few days. Recently outlook has started complaining (it had been working for many years) and now blocks access requiring me to click OK in the window it pops up. I can't see any way to stop outlook showing the window or getting it to auto allow my app. Can anybody help me to disable this or get it to allow my app automatically ?
If the is a way to access the pst file with admin rights (I currently do it via OLE) I am happy to edit the code.
5 Replies
- LauraBennettBrass Contributor
That sounds like classic Outlook’s Object Model Guard, which checks certain operations made through OLE/COM automation. Running your app as administrator will not bypass it. Your code is accessing Outlook’s object model, rather than reading the PST directly.
Since the warning started after years of normal operation, check this first:
- In Outlook, open File > Options > Trust Center > Trust Center Settings > Programmatic Access.
- Check the Antivirus status shown there. If it says inactive, invalid or out of date, check Windows Security > Virus & threat protection > Manage providers and make sure your antivirus is active and updated. Restart Outlook afterward.
- If the antivirus status is valid, check whether Outlook is configured to always warn. On a managed computer, your administrator may control this setting.
Outlook does not offer a simple “always trust this executable” list for external automation apps. The Never warn option, where available, removes protection broadly rather than just allowing your app, so it is not a good per-app solution.
For a code fix, identify the exact property or method that triggers the prompt. Basic appointment fields such as Subject, Start and End are generally not what triggers address-access warnings; reading recipient addresses or other protected properties can. If your display only needs dates and titles, removing unnecessary protected-property access may eliminate the prompt.
If protected access is essential, Outlook Redemption is an established third-party option for accessing Outlook data through Extended MAPI. Check its licensing and deployment requirements. Elevating your existing OLE code is not the fix.
- Lorne54Copper Contributor
Thanks for the time you took to write this.
However I am confused - services.msc tells me Microsoft Defender is running and set to auto start but Outlook Programmatic Access says AntiVirus is inactive. The option that notifies me when data is accessed but antivirus is not running is selected but greyed out so can't be altered. Any ideas why Outlook thinks Defender is not running ?
Outlook takes the virus scanner status that is being reported in Windows.
Use the Windows Security app to see the actual status of your virus scanner. When the virus scanner definitions are outdated, the status will turn to Invalid/Inactive as well.
The Programmatic Access settings can only be changed as an administrator or per Group Policy. However, setting it to a lower level of protection is not recommended as a permanent solution, but only as a troubleshooting step.
Additionally see; Fixed: "A program is trying to send an email message on your behalf" (Outlook) - Robert 365
- SynthiaHongTin Contributor
I’ve seen this happen when an add-in or another app is trying to access Outlook in the background. I’d check your installed Outlook add-ins first and disable anything you don’t recognize or no longer use. If it keeps popping up, try starting Outlook in Safe Mode to narrow down which add-in is causing it.