AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Automatically click on Enable Macros when Excel starts

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
zorrozac



Joined: 12 Mar 2010
Posts: 26

PostPosted: Fri Mar 12, 2010 12:40 pm    Post subject: Automatically click on Enable Macros when Excel starts Reply with quote

Hi,

I would be extremely happy if anyone can provide me with a simple script that can do the following:

Simply click on the "Enable Macros" button when Excel starts, as soon
as AutoHotkey detects the "Security Warning" window appearing.

This is required for a shared workbook that needs to run macros.

Thanking you in advance.

Kevin Broadfield
Back to top
View user's profile Send private message Send e-mail
Murx
Guest





PostPosted: Fri Mar 12, 2010 1:43 pm    Post subject: Reply with quote

A perfect attempt to start unwanted macros/malware! Shocked
Back to top
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Fri Mar 12, 2010 3:05 pm    Post subject: Reply with quote

I dont want to jump to any conclusions here so I'm trying to fully understand the question.
To the OP, do you mean click on this?

_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
kevin broadfield
Guest





PostPosted: Fri Mar 12, 2010 3:29 pm    Post subject: Automatically click on Enable Macros when Excel starts Reply with quote

Hi again,

Can I say at the outset, if my intentions were not noble, this request could have been very easily been disguised with a different window and button text.

As stated, my reason for this request is to force all users of a particular Excel file to be under total control of workbook macros, which is a perfectly legitimate reason for its use.

A staggering number of users on the internet seem to have this problem and are seeking resolutions.

Obviously, to prevent brain-dead idiots from viewing the script, I would expect it to be delivered in a Private Message or a direct email to me at zorro@blackmask.fsnet.co.uk.

As I can program a little in VB, it will be a relatively easy task to prevent any other users from utilizing the script, when the script is buried within an EXE that is in itself within another EXE.

I hope that I have assured you of my integrity.

In answer to the last entry, when you open an Excel file that contains macros, you are confronted with a window whose text is "Security Warning" and you are provided with 3 choices Disable Macros, Enable Macros and More Info.

Any help via a PM or email will be greatly appreciated.


Kevin Broadfield
Back to top
kevin broadfield
Guest





PostPosted: Fri Mar 12, 2010 6:19 pm    Post subject: Automatically click on Enable Macros when Excel starts Reply with quote

Problem Resolved.

Thank you all for your interest and comments.

It was only a few simple lines of Autohotkey code, which will not be divulged
by me to any potential hacker.


Best regards,

Kevin Broadfield
Back to top
flyingDman



Joined: 27 Feb 2009
Posts: 690
Location: Burbank, California

PostPosted: Fri Mar 12, 2010 6:52 pm    Post subject: Reply with quote

If you are the creator of the Excel macros, a better way to achieve this and keep malware at bay is to digitally certify your macros (see http://office.microsoft.com/en-us/help/HP052495571033.aspx . I must admit I've never have to do this yet) and have the settings changed for Excel to only accept certified macros. With the code you were provided (which I am sure is not complicated), you are allowing any macro to run and is therefore equivalent to changing the setting of Excel to accept all macros as shown below (xl 07).

_________________
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom" but let's start to get the data...
Back to top
View user's profile Send private message
kevin broadfield
Guest





PostPosted: Fri Mar 12, 2010 9:40 pm    Post subject: Automatically click on Enable Macros when Excel starts Reply with quote

Thank you for additional information regards digital signatures.

It is my experience that creating the digital certificate is quite easy and the authority works as soon as you re-open the file.

Unfortunately, it is my experience that these signatures which are still present on the system, become disengaged from the file itself and authority is lost until you choose the certificate again.

Can I just add that I was not provided with the script from anyone except the Autohotkey tutorial itself - i.e. I got the answer myself.

Regards your comment that I am in effect setting the option to LOW and thus allowing any macro to have authority is completely wrong.

To elaborate slightly on what I have mentioned earlier regards the scripts execution - the Excel invocation and the call to the Autohotkey script ( which is now an EXE ) is contained within the Visual Basic EXE.

The path is hard-coded within the EXE and as a result, it cannot be used
for any other file or macro - especially when I have additional checks on the path given.

I can also split the path string into two unrecognisable strings that have to be OR'ed before the true name is discovered - this way, the path cannot be read even when viewed by a HEX editor.

So you see, I am keeping everything quite safe.

I hope that I have cleared any lingering doubt regards using this method.

Regards,

Kevin
Back to top
flyingDman



Joined: 27 Feb 2009
Posts: 690
Location: Burbank, California

PostPosted: Fri Mar 12, 2010 9:47 pm    Post subject: Reply with quote

Thanks for clarifying. Makes a lot more sense now.
_________________
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom" but let's start to get the data...
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Fri Mar 12, 2010 9:56 pm    Post subject: Reply with quote

whenever excel is opened via COM weather its vbs jscript or ahk etc this prompt is bypassed
perhaps look at http://www.autohotkey.com/forum/viewtopic.php?t=31923
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group