Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 



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:19 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