Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Force an Excel recipient to accept VBA macro

0

Hi -I saw a tip from this group once on how to Force an Excel recipient to accept VBA macro. I would like to have someone download an Excel filel form my website and have it run VBA code with then havong to go throught the various steps in the Trust Center to accept VBA code. 

Is there some VBA code I can attach to my Excle workbook to make this happen? Lastly, will this work on Excel 4.0 macros as well as I have a few of those in my Workbook as well.

I have VBA code from John Ru in the attached sheet. CTR Y shows column and row headings and CTR M hides columns and rows.

Thank you

Answer
Discuss

Discussion

Hello marko14 and welcome,

Have a look at Don's tutorial on the TeachExcel site:
[LINK URL="Force a User to Enable Macros in Excel - Advanced Version - TeachExcel.com"]Make Users Enable Macros[/LINK]
This may be what you need.

Cheers   :-)
WillieD24 (rep: 557) Jul 20, '23 at 12:08 am
Thanks Willie
marko14 (rep: 8) Aug 1, '23 at 8:02 pm
Add to Discussion

Answers

0
Selected Answer

Marko

It wasn't a tip but one of Don's excellent Tutorials, to be found here: Force a User to Enable Macros in Excel - Advanced Version.

I can't recommend forcing users to use Excel 4.0 macros since they represent a security risk (and are often used for malware, hence blocked by default) but the Trust Center setting "Enable Excel 4.0..." can be set- see the Microsoft guidance here:  Working with Excel 4.0 macros.

Alternatively you might be able to use the Microsoft guidance note there:Application.ExecuteExcel4Macro method (Excel) to change parts of your code (if simple).

In reality, the best thing would be to rewrite the Excel 4.0 code in VBA then just use Don's method.

Discuss

Discussion

Did that work for you, Marko? 
John_Ru (rep: 6142) Jul 25, '23 at 1:02 am
Looks like I wasted my time trying to help you!
John_Ru (rep: 6142) Jul 28, '23 at 4:36 pm
Thanks for the reply John. I am familiar with the Macro settings in Trust Center. Is there an automated way to convert my 4.0 macros to VBA? I don't know if you looked at my 4.0  Macros in the Macro tab. I have no idea if they could easily be ported to VBA.
As always, Thank you for your reply.
marko14 (rep: 8) Aug 1, '23 at 8:02 pm
Marko. I've never used 4.0 macros and suspect there is no conversion tool but I'm pretty sure they could be rewritten in VBA. Haven't had chance to look at your code but will try to find time. If the 4.0 code is not commented, can you describe what it does? 
John_Ru (rep: 6142) Aug 2, '23 at 6:57 pm
Thanks John -
The 4.0 code is quite simple.On the sheet I sent you, iin the Macro tab they 4.0s I'd like to covert to VBA are in Columns I-N. They simply allow the user to click on any team name in the Games tab and tit wil then jump to that team's entire season data.
The Macro matches the team name to a defined name cell on the elsewhere in the Workbook. So ythe Macos says "go to the defined name that is is clicked on.  I have written a 4.0 Macro for each tream name in the games and first Five tab as well a couple of other places.
I would think that it woud require a separate VBA code for each name in the Games and First FIve tabs.
Thanks again for your help
marko14 (rep: 8) Aug 3, '23 at 3:30 pm
Marko

Kindly ask a new question on converting your specific 4.0 code (please show using CODE button) to VBA. Attach file too. 

I think I'll be able to do it but not sure if I'll have time (so maybe WillieD24 will do it) 
John_Ru (rep: 6142) Aug 3, '23 at 6:02 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login