Microsoft Excel - Macro Security Problem
Asked By Don Brown
03-Feb-12 03:46 PM
Hello All, I'm having what I believe is an Excel problem but my code is in Access. When I open an Excel 2007 file (.xlsm)with a few macros in it using the double-click on the filename in its directory, the file opens without any warnings since I have the directory the file is in listed in the 'Trusted Locations' section of Excel Options. The problem arises when I open the same file in VBA code using Set objexcel = CreateObject("Excel.Application") followed by Set wbexcel = objexcel.Workbooks.Open(strSaveFile). The file opens without any warnings, but when I run one of the embedded macros in that spreadsheet, I get the 'Macros Disabled' message and I have to select the 'Allow' button to get any macros to run. I tried researching the 'Application' properties within Excel to see if the was a setting I could set on like I would with .Visible=true but I couldn't find anything that related to macro security/settings. Anyone have any ideas???
Thanks
Donald Ross replied to Don Brown
Have you looked into the security settings in excel under the trust center tab
Don
Amit Choudhary replied to Don Brown
Hi ,
It is Macro security issue , i have faced it many times.
Please reset these settings on your excel.
1. Go to Tools -> Macro -> Security
2. There you will find 2 tabs
a. Security Level
Set Security Level Low to run macro.
b. Trusted sources.
Set On for "Trust All Installed addins and templates"
Set On for "Trust Access to Visual Basic Projects"
Hope this will resolve your problem
Blue J replied to Amit Choudhary
Hi..
The above solutions should help you out... i am sure as i also faced the same issue many times..
let me know if you still face the problem... :)
Thanks
Blue J
Anoop S replied to Don Brown
Its related to macro security level problem, This problem occurs ( macro disabled error) when you run any of the sample macros in the your excel file included with Microsoft Excel or Microsoft Office and you have set the security level for macros to High.
first close your file if its open
On the Tools menu, point to Macro and click Security.
In the Security dialog box, click the Security Level tab.
Click Medium and then click OK.
then run open the file
Pichart Y. replied to Don Brown
Hi Don Brown,
I am not sure if this work, please try and let me know, too.
How about this code...have you try...
Application.DisplayAlerts = False
Application.DisplayAlerts = True
pichart Y.
Pat Hartman replied to Don Brown
If none of the other suggestions solve the problem, try adding the spreadsheet's directory to Access' trusted locations.
Don Brown replied to Don Brown

Thanks all for your recommendations. Here's a little further explanation and what finally worked. I am using Excel 2007. The macros in the excel template in question are running from an add-in that I have located in the add-ins folder in the path c:\documentsandsettings\myuserid\application data\microsoft\addIns. If I open the template by double-clicking and run the addIn/macro, it works without issue, but if I open that same template as part of VB code in Access and try to run the same macro/AddIn, it gives the security message. I have all my development files, etc. in a "Trusted Location" including subfolders that I added when I first installed 2007. What I hadn't noticed was that the "Default AddIns" location given in the list of Trusted Locations points to the system addins location, not the user default addins folder. When I added the user default location listed above as a Trusted Location, the macros/addins run without any security message. I am still set at "Disable with Notification" in my Trust Center settings for macros, I didn't want to create any unnecessary exposures by changing that to run anything that comes by. I thank you all for your input and hope this may help someone else.
DB

excel macro Excel All I want is a simple macro to move down one row and then over to the far left If I were ctrl][left] What is the code that I would put in Visual Basic for this macro. If I use the record feature, it keeps taking me to the original cell. This used to be so easy in the older versions. Excel Programming Discussions ActiveCell (1) XlToLeft (1 RE (1) Macro (1) Iguessiamadumbass (1) Charles (1) Offset (1) Excel (1) ActiveCell.Offset(1).End(xlToLeft).Select
supress display during execution of an excel macro Excel What is the vba code to turn off the display during the execution of an excel 2007 macro? Excel Programming Discussions Macro (1) Littleton (1) Stu (1) Supress (1) Application. ScreenUpdating = False ' your code Application. ScreenUpdating = True Regards Trevor Thank you Trevor, that works beautifully! You're welcome. Thanks for the feedback. keywords: supress, display, during, execution, of, an, excel, macro description
Macro excel Excel Bonjour, Je cherche une macro qui me permette de prendre des donn?es sur plusieurs feuilles pour les synth?tiser sur une derni?re nomm?e "R?cap" J'ai un onglet par personne et six scores ? r?cup ne sais pas si je suis suffisamment claire. . . . ? Merci pour votre aide H?l?ne Excel - French Discussions Macro (1) Bonjour, Regarde du c?t? de "Donn?es", "Consolidation". Daniel keywords: Macro, excel description: Bonjour, Je cherche une macro qui me permette de prendre des donnes sur
Re : Excel Wrap-Text with Relatively Loose Strings Excel Re : Excel Wrap-Text with Relatively Loose Strings 1. Enters an Excel worksheet (received from the wilderness). 2. In a fixed-width cell, there is an entry 3 spaces and beyond. 7. Please share your experiences and recommend a solution. 8. Regards. Excel Discussions Excel (1) Worksheet (1) Macro (1) VBA (1) VB (1) CreateObject (1) Vbscript.regexp (1) Solenoid
Help with an Excel Macro Excel I am doing a macro that opens an excel workbook, then refreshes the data from an external database. I then save and close the excel workbook. When I look at the macro in the immediate window it appears to work fine, but when I try to run am doing wrong. Any help would be greatly appreciated. I am relatively new to using excel. Excel Programming Discussions QueryTable (1) Excel (1) Database (1) As ALWAYS, post your efforts for