Using a macro to open a macroenabled file which has autorun but autorun doesn't work

aequitas1903

Board Regular
Joined
Mar 8, 2012
Messages
127
Hello everyone,

I searched the forum and internet but couldn't find the answer I need. I don't know if I found a bug within excel. Here is the story:

I am using an excel file (lets say "xlsm1") which has a userform in it (actually I am just letting the user to see the userform) With this userform, users can easily open templates and documents (xltm, xlsm, doc, docx, pptx, etc...)

My problem is some of the templates, which can be selected in userform, has auto_run macros in them (lets say "xlsm2"). And in this auto_run macros, code is checking if the user is allowed to open the file according to environ username.
If I open xlsm2 individually auto_run works and checks access, but If I open xlsm2 through xlsm1. It doesn't check if I am allowed or not.

Right now I am kind of disappointed :) Because it means I can open any files which has an auto_run to check if the user is allowed. Even if I am not allowed, I can open them.

Please let me know if you have any idea how I can make the auto_run work.

BTW still disappointed :)
Cheers
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

aequitas1903

Board Regular
Joined
Mar 8, 2012
Messages
127
Hello again,

I was still trying to figure out a way and tried to password protect the excel file(xlsm2). And I also learned if you password protect an xlsm file autorun macro doesnt work. I protected the xlsm and tried to open through userform(xlsm1) it asked me the password but autorun macro didn't work neither. I tried to open the file(xlsm2) individually and after I enter the password autorun didnt work again. :/

Your knowledge and thoughts are much appreciated.
Cheers
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,821
Messages
5,766,639
Members
425,364
Latest member
jstubs99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top