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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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
 
Upvote 0

Forum statistics

Threads
1,213,501
Messages
6,114,010
Members
448,543
Latest member
MartinLarkin

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
Back
Top