Trusted Offices

I am curious how best to approach this situation. I have an old VBA book that works fine. Unfortunately, with the new security measures in Office 2007/2010, you get the message "Security warning. Some active content has been disabled." I know that I can click on the message and choose to include content or add it to a safe place. Unfortunately, doing this every time is a little painful for end users. Thus, I created an installation project in Visual Studio that launched a console application that would copy the file to the templates folder and then put short text on it. Maintaining this is the case because I am not adding updates to the Excel file the engineer does. Therefore, I need to recreate the setup.exe file for 32/64 bits.

What is the best solution?

It should work with Windows Vista / 7 32/64 bit and Office 2007/2010 32 bit, and users will have different computer skills.

+1
source share
3 answers

Send this link to all users. This is a pretty good walk on how to make sure your file opens with macros enabled. It also gives you several different ways to do this, depending on your situation.

http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-files-HA010354316.aspx

0
source

I have a similar situation and took care of this with some registries.

HKCU\Software\Microsoft\Office\12.0\Excel\Security\Trusted Locations\AllowNetworkLocations=1 [DWORD]
HKCU\Software\Microsoft\Office\12.0\Excel\Security\AccessVBOM=1 [DWORD]
KHCU\Software\Microsoft\Office\12.0\Excel\Security\VBAWarnings=1 [DWORD]
KHLM\Software\Microsoft\Office\Common\Security\UFIControls=1 [DWORD]

Perhaps a quick search of the VBA registry files will help you.

0
source

, : " ".

, , , :

"Office . , ".

VBA ( ), , Daniel Pineault DevHut.net 2010 :

DevHut: VBScript

, Excel:


Public &nbsp Sub; TrustThisFolder ( __ &nbsp ; String, _                             &nbsp ; TrustSubfolders &nbsp ; = , _                             &nbsp ; TrustNetworkFolders &nbsp ; = , _                             & NBSP; sDescription &nbsp ; )

'     ,  ' Trusted VBA "  Excel  " Office   "   . & ​​NBSP;  . "

'  Ths : '   ' Trusted '  "  ,   ; & ​​NBSP;     ; False

'  Nigel Heffernan   , 2015 ' "  Based Daniel Pineault DevHut.net 23, 2010:"   www.devhut.net\2010\06\23\VBScript-createset- -VBScript\

'  **** **** **** ****   CODE IS   PUBLIC DOMAIN   ** ** ****   ****; ****

'    ; : ' '  1:      ,  ' Debug.Print sSubKey & vbTab & SPATH "  2:       Open, Immediate Window   ; & ​​NBSP; :"             TrustThisFolder "Z: \", , , "  " "  3:       "Z: \"    , , "  4:     2 3:  ,  , "  5:     & ​​NBSP; ,  ,

Error GoTo ErrSub

sKeyPath       ;

oRegistry     ; Dim sSubKey     As Dim oSubKeys     '   . & ​​NBSP; , & ​​NBSP; oSubKey     '    ;.

bSubFolders           ; bNetworkLocation     As Boolean

iTrustNetwork         ;

SPATH     ; Dim SDATE   As Dim sDesc   As         ;

HKEY_CURRENT_USER = & H80000001

bSubFolders = bNetworkLocation = False

__ = ""       __; = FSO.GetSpecialFolder(2).Path     sDescription = ""         sDescription = "  "       End; End

(__, 1) < > "\"       __; = __ &amp; "\" End

 

sKeyPath = " "sKeyPath = sKeyPath &" SOFTWARE\Microsoft\Office \" sKeyPath = sKeyPath & Application.Version sKeyPath = sKeyPath & "\ Excel\Security\ Locations \"       oRegistry = GetObject ( "winmgmts:\\ \ : StdRegProv." ) "    :  ,  \\cimv2   WMI : StdRegProv   oRegistry.EnumKey HKEY_CURRENT_USER, sKeyPath, oSubKeys

  ; oSubKey   In; oSubKeys

      sSubKey; = CStr (oSubKey)     oRegistry.GetStringValue HKEY_CURRENT_USER, sKeyPath & "\" & sSubKey, "", SPATH           'Debug.Print sSubKey & vbTab & SPATH               SPATH = __               End;      

      oSubKey

SPATH < > __

    IsNumeric (Replace (sSubKey, "", ""))         = CLng ( (sSubKey, "", "")) + 1               ; = UBOUND (oSubKeys) + 1       End;             sSubKey; = "" & CStr ()           TrustNetworkFolders           iTrustNetwork; = 1           oRegistry.GetDWORDValue; HKEY_CURRENT_USER, sKeyPath, "AllowNetworkLocations", iTrustNetwork         iTrustNetwork = 0             oRegistry.SetDWORDValue HKEY_CURRENT_USER, sKeyPath, "AllowNetworkLocations", 1           End;       End;             oRegistry.CreateKey; HKEY_CURRENT_USER, sKeyPath & "\" & sSubKey     oRegistry.SetStringValue HKEY_CURRENT_USER, sKeyPath & "\" & sSubKey, "", __     oRegistry.SetStringValue HKEY_CURRENT_USER, sKeyPath & "\" & sSubKey, "", sDescription     oRegistry.SetDWORDValue HKEY_CURRENT_USER, sKeyPath & "\" & sSubKey, "AllowSubFolders", 1       End

ExitSub:

    & nbsp Set; oRegistry = Nothing Sub Output

ErrSub: & nbsp Summary; ExitSub

End sub

Please make a confirmation in the code if you reuse it: this will distinguish you (and StackOverflow) from other messages and other sites where experts (and others) share knowledge without confirmation.

0
source

All Articles