Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2023, 10:10 PM
ksor ksor is offline "Security center" NOT working or messed up !!! Windows 10 "Security center" NOT working or messed up !!! Office 2016
Advanced Beginner
"Security center" NOT working or messed up !!!
 
Join Date: Feb 2018
Location: Århus V, Denmark
Posts: 74
ksor is on a distinguished road
Default "Security center" NOT working or messed up !!!

I have an Access application creating some Word documents.




I want these documents (created via my Access application) based on a special template - let's call it "AccWrdTemplate.dotm".


I have the template stored side by side the Normal.dotm in the folder "C:\Users\kelds\AppData\Roaming\Microsoft\Template s"


It works nicely when I use the Normal.dotm template but NOT when I use AccWrdTemplate.dotm - macros is blocked ... in fact my special template is just to a start a COPY of the Normal.dotm !


Why is the FILE NAME so cardinal here - that's the ONLY difference !

Here are the code I use:


Code:
        Set WRDobj = CreateObject("Word.Application")
'        WRDobj.Visible = False
        Set Doc = WRDobj.Documents.add(Environ("SlgtSysWordSkabelon"))
        Doc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "NotatID: " & Me.NotatID.Value & "-" & Me.Benævnelse.Value
        Doc.SaveAs Environ("SlægtHovedmappe") & "\" & "NOTAT_docs\" & Me.Sti_til_fil.Text, wdFormatDocumentDefault
        WRDobj.Quit
        Set Doc = Nothing
        Set WRDobj = Nothing
What the Heck is wrong with this "Security Center" ... I can see others have lots of problems too !

Maybe I should say that the 'shift' from Normal.dotm to AccWrdTemplate.dotm is done by changing the enviroment variable "SlgtSysWordSkabelon" - so

no code is changed
no storage is changed
ONLY the file name is changing - Normal.dotm is OK, but AccWrdTemplate.dotm is NOT - it block for macros !


If I 2-click the dotm file it works nicely in BOTH cases - no warning of blocked macros !!!


Now comes the FUN PART: If I store my special template in a special folder AND give it the file name Normal.dotm ... then NO warning of blocked macros comes up !
OH, NO ... something else fooled me here !


HALLOOOOO MS people if you are here - do something about this problem or tell me what I do wrong !!

Last edited by ksor; 07-16-2023 at 03:28 AM.
Reply With Quote
  #2  
Old 07-16-2023, 07:43 AM
Italophile Italophile is offline "Security center" NOT working or messed up !!! Windows 11 "Security center" NOT working or messed up !!! Office 2021
Expert
 
Join Date: Mar 2022
Posts: 338
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Nothing is wrong with the Security Center.

Normal.dotm is not a document template. It is a global template that is required for Word to work correctly. If Word cannot find Normal.dotm at startup it will create a new one. It is a special case and different rules apply than to other templates.

For code in a document template to run the folder in which it is located must be a trusted location, which you can set in the Trusted Locations tab of the Trust Center.

FYI - this forum is not affiliated with Microsoft. There are no Microsoft people here.
Reply With Quote
  #3  
Old 07-17-2023, 12:06 AM
ksor ksor is offline "Security center" NOT working or messed up !!! Windows 10 "Security center" NOT working or messed up !!! Office 2016
Advanced Beginner
"Security center" NOT working or messed up !!!
 
Join Date: Feb 2018
Location: Århus V, Denmark
Posts: 74
ksor is on a distinguished road
Talking

I don't think you've red my initial posting OR the many postings where people are frustrated on how to deal with all the checkmarks in the "Secrity center" !


I use the folder for user templates - the same folder as the normal.dotm is placed !

I take a COPY of the normal.dotm to use as my special template - in the same folder - normal.dotm works but my special template DON'T !

The user template folder IS defined as a safe place in the "Security center" !

So please explane why it still blocks macros.

I know the forum is not a part of the MS organisation but I hope some MS-people are looking for what's cooking here and there - I've have experienced that before - that's why I wrote as I did.

Last edited by ksor; 07-17-2023 at 04:40 AM.
Reply With Quote
  #4  
Old 07-18-2023, 09:58 PM
ksor ksor is offline "Security center" NOT working or messed up !!! Windows 10 "Security center" NOT working or messed up !!! Office 2016
Advanced Beginner
"Security center" NOT working or messed up !!!
 
Join Date: Feb 2018
Location: Århus V, Denmark
Posts: 74
ksor is on a distinguished road
Default

@Italophile


No, explanaton ?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
The "Security center" settings ??? ksor Word VBA 2 07-15-2023 08:34 AM
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro Matt C Excel Programming 2 01-08-2022 06:03 AM
"Security center" NOT working or messed up !!! Security problem? "This macro can't be found or is disabled." gregrivet Word 5 07-13-2020 06:52 AM
Using Word is impossible as a box headed "Windows Security" keeps popping up Hambagashle Word 1 07-29-2014 04:31 AM
"Security center" NOT working or messed up !!! How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft