Any way to auto enable Macros in Excel? - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Any way to auto enable Macros in Excel?

dre1988 Avatar
6y, 8m agoPosted 6 years, 8 months ago
Hi guys,

Got a quick excel question,

I'm quite an advanced user in Excel but I can't for the life of me work out how to auto enable macros on one workbook.

I've thought of possibly using a welcome sheet and hide all other sheets until the user "enables macros" but I can't get the visual basic code to work.

Any ideas?

Im using Excel 2007
dre1988 Avatar
6y, 8m agoPosted 6 years, 8 months ago
Options

All Comments

(21) Jump to unreadPost a comment
Comments/page:
#1
Ive thought about using something like this, but the code doesnt work for me, the sheets are still visible when I open the workbook.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=379
#2
I cant remember what you need to name the macro now, ages since I done it, but once the workbook is opened, you can enable a macro to auto run on opening.
#3
ChrisUK
I cant remember what you need to name the macro now, ages since I done it, but once the workbook is opened, you can enable a macro to auto run on opening.


so i could possibly auto enable a macro to enable macros? haha
#4
Tools > Macros > Security > Set to low

Should do the trick?

*edit*

Sorry didn't realise it was for a single w/book.
#5
dre1988;8191145
so i could possibly auto enable a macro to enable macros? haha


lol, you could use the "auto" macro to call your 1st one & go from there.
#6
Have a look in the trust centre.... set the path for the file in the "trusted locations" section... this should automatically enable macro's for the file!

(office button > excel options > trust center > trust centre settings)
#7
Just realised an auto macro wont work, because when you first open the workbook macros are disabled, so it wouldnt run the auto macro until i enabled macros again. lol
#8
DragonChris
Tools > Macros > Security > Set to low

Should do the trick?

*edit*

Sorry didn't realise it was for a single w/book.


Ambdon
Have a look in the trust centre.... set the path for the file in the "trusted locations" section... this should automatically enable macro's for the file!

(office button > excel options > trust center > trust centre settings)


yeah this enables macros for whenever I use excel on my computer but Im trying to do it to an excel file on my network in work, basically for the people I work with who want to use the file and don't know how to enable macros this won't be a problem for them.

maybe should have made that clearer sorry.
#9
did you try putting the UNC path to see if it works? (or alternatively, if everyone has a standard mapping, use that drive letter)

note - you might have to tick the "Allow Trusted Locations on my network (not recommended)"
#10
#11
Can I ask what happens when you use your linked example, works fine for me.
#12
Can you not save as a macro enabled workbook - .xlsm instead of xlsx

It's one of the options under save as type
#13
Bud Fox
Can you not save as a macro enabled workbook - .xlsm instead of xlsx

It's one of the options under save as type


It still doesn't open up automatically with the macros working which is what the OP is after really.

To my knowledge you cannot get excel to open up with the macros working automatically (as that's the whole point of it), the work around is that you force to the user to enable them in order to carry on.
#14
OP do you have your settings set to low or medium security?

If set to low that's why the above linked work around does not work.
#15
greg_68
OP do you have your settings set to low or medium security?

If set to low that's why the above linked work around does not work.


When I did the above nothing happens, all the pages are still visible,

erm which security settings do you mean mate?

the trust centre settings on excel options?
#16
dre1988
When I did the above nothing happens, all the pages are still visible,

erm which security settings do you mean mate?

the trust centre settings on excel options?


Tools > Macro's > Security. (in 2003 anyway)
#17
greg_68
Tools > Macro's > Security. (in 2003 anyway)


Yeah in 2007 its throught excel options, trust settings and macro settings.

ive tried that but it doesnt work. the only thing i can think of as to why its not working is possibly because im using Excel 2007 instead of 2003. and maybe the code in the links for VB were written for 2003.

Ive been trying to do it for a few hours now, may just give up before I lose the plot haha
#18
Did you download the file attached to the link, and did you try opening it?
#19
greg_68
Did you download the file attached to the link, and did you try opening it?


yep done that and the one in the file works. even tried copying the code straight from that visual basic into my workbook and it doesnt work, must be something im doing wrong somewhere.
#20
dre1988
yep done that and the one in the file works. even tried copying the code straight from that visual basic into my workbook and it doesnt work, must be something im doing wrong somewhere.


Did you remember to rename one of the sheets or insert another called macros?

Edit, you are right when I paste it into one of my workbooks it doesn't work does it?
#21
greg_68
Did you remember to rename one of the sheets or insert another called macros?

Edit, you are right when I paste it into one of my workbooks it doesn't work does it?


nope lol, doesnt seem to work even after making the changes, it's a pain in the bum.

Think I might just start from scratch in access lol

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!