MS Office 2019 - Temporary Word File in ..\INetCache\Content.Word are not trusted

Bill Meyers 66 Reputation points
2023-01-04T19:10:40.857+00:00

I am running MS Office 2019 on a Windows 10 system.
At some point in the 2nd half of 2022, I started to receive the message:
Microsoft Office has identified a potential security concern.
Microsoft has blocked macros from running because the source of this file is untrusted.
![276196-image.png][1]
I am using a template that is populated from an MS Access VBA script. The template is located in C:\Users\bmeyers\AppData\Roaming\Argo Job View FE.
30 Set objWord = CreateObject("Word.Application")
40 objWord.Visible = False 'True is visible
'load template
50 With objWord
60 PathDir = Environ("AppData") & "\Argo Job View FE\QS-AUD-003 BATCH AUDIT LOG.dot"
70 .Documents.Add (PathDir)
It worked well for years under MS Office 2016 and 2019 but now always the message. I tried setting the Trusted Location to this specific folder and even the entire C: drive but I can't prevent this message.
276176-image.png
If I log into the computer as an Administrator, I don't get the message, just when I'm logged in as a Standard User. My IT policies require me to have only Standard User access.
I keep up to date with all Windows updates including MS Office. I am running MS Office Home and Business 2019 Version 2211 (Build 15831.20208 Click-to-Run).
It doesn't stop me from opening the template, just disables macros.
276156-image.png
Anybody have any suggestions? Thank you.
[1]: /api/attachments/276196-image.png?platform=QnA

Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
891 questions
{count} votes

Accepted answer
  1. Mikel AA 80 Reputation points
    2024-02-06T11:01:17.46+00:00

    Hello @Bill Meyers , I found the solution in another post! This is my code, hope this helps you:

    Sub XLS_to_Word()
        Dim objWord As Object
    
        ' Tries to get an instance of Word
        On Error Resume Next
        Set objWord = GetObject(, "Word.Application")
        On Error GoTo 0
    
        If objWord Is Nothing Then
            ' Word was not opened, so create an object
            Set objWord = CreateObject("Word.Application")
        End If
        On Error Resume Next
        
        objWord.Documents.Add "C:\...\Template.docm", False, 0
        
        ModifyWord objWord 'Sub to add text, images, etc
        
        ' Save the document with a new name
        objWord.ActiveDocument.SaveAs "C:\...\" & Sheets("aux").Range("K1").Value & ".docm", FileFormat:=13
    
        ' Close the word
        objWord.Quit
        Set objWord = Nothing
        On Error GoTo 0
    
    End Sub
    
    1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. John Korchok 5,446 Reputation points
    2023-01-04T22:29:32.217+00:00

    Microsoft recently went on a security rampage that disables many macros in many situations. Here is their page on the subject, which may or may not help in your situation:
    https://learn.microsoft.com/en-us/deployoffice/security/internet-macros-blocked

    3 people found this answer helpful.

  2. Mike 5 Reputation points
    2023-10-04T12:12:41.8933333+00:00

    Had the same problem. My macro to create a word template from an excel file was working perfectly last week, and then this week it was not. Exactly as described above: run time error unless I closed the warning fast enough, but the warning was sometimes hidden behind the excel window. SOLUTION: In the Trust Center, under "Protected View", you have to uncheck the option for "files located in potentially unsafe locations". I would leave the others though...Screenshot (165)

    1 person found this answer helpful.

  3. Oskar Shon 866 Reputation points
    2023-01-04T22:58:07.873+00:00

    Try to add your SharePoint or intranet serwer location to internet control panel interface.

    276291-xl-zablokowane-lokalizacje2-vba-makra.jpg

    Regards


  4. Bill Meyers 66 Reputation points
    2023-10-04T12:48:59.19+00:00

    Mike, I'm glad you resolved your issue. I'm creating a word document from a template through MS Access which does not have the Protected View option in the Trust Center (I already had this setting unchecked in Word). I did try to enable everything that allows things to happen (like Macros and Active-X) and disable everything that denies but no change.

    MS Access Trust Center

    I still to this day (10-4-23, almost a year) get this popup and need to click through in order to open the template.

    User's image

    The problem is Microsoft automatically creates the temp file each time and stores this file in a protected location that cannot be added to Trusted Locations. I don't know if there is a setting somewhere to change this behavior, I haven't found it.

    It's gets tiresome having BIG BROTHER trying to protect you even when you are trying to take advantage of techniques Microsoft created in an effort to make your life easier. They first give you a tool to use and then take it away. At least let you say this is OK and remember that setting instead of each time forcing you to Disable Macros.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.