PDA

View Full Version : VBA: Enable Editing



steelstorm
11-02-2012, 05:31 AM
I recently wrote an addin to help a fellow employee. What it does is navigate to our companies website, it logs her in and navigates her to a page to pull a report automatically. Now the problem I'm having is once I get this new workbook opened on the screen you have to click "Enable Editing" at the top of the excel window (2010 if that matters).

For now I manually have her do this, then run a second macro that sorts and filters the spreadsheet the way she needs it. Now my question is: Is there a way with VBA to click the Enable Editing button for me so I can put the 2 addins into one to automate this even more?

I researched this on the net for a little and was unable to find an answer. Thanks in advance for any advice or help.

Arbitel
11-02-2012, 08:25 AM
Go to Files > Options > Trust Center > Trust Center Settings > Macro Settings > Enable All macros.

It wouldn't prompt for Enable Editting but beware of opening malicious documents,

steelstorm
11-02-2012, 08:39 AM
For some reason that alone did not work. Also in trust center in "Protected View" I had to uncheck the internet and unsafe location options and it does not prompt this now.

Is there possibly anyway to temporarily disable these features in the code and have them turned back on at the end for safety?

Arbitel
11-02-2012, 10:41 AM
Unfortunately, as far as I know you can't change the settings with VBA. That's the whole point of the settings in the first place right ? ;)

steelstorm
11-02-2012, 10:44 AM
I read in sharepoint server that sites can be set up as trusted for excel....not sure if this is something that is even possible in AD but I guess i'll look into it a little more.

Thanks for the replies! I was thinking that would probably be the case but it's always worth a shot asking because I'm definitely still in the learning process.

Teeroy
11-03-2012, 11:43 PM
If you could digitally sign the Macro it should reduce (eliminate?) any problems created by the Trust Center.

steelstorm
11-05-2012, 06:27 AM
I do remember seeing something in regards to this browsing some answers online. I will look into it more and if its nothing to extensive to do (never done it before) maybe I'll give it a shot.

Thanks everyone for the replies.