Obligate macro run

Bieli

New Member
Joined
Sep 11, 2011
Messages
10
Is there any way to not allowing opening Excel file without macro?

I think it is. Once (by mistake) I put some shortcut. After that it create Macro1 sheet. When I close and opened file with dissabling macro I got something like "This sheet can not be open without macros" and workbook was close after clicking OK. Normaly when you disable macro the sheets are opened anyway.

I have no idea how I did it. Any suggestions?

Best Regards
Bieli
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Whats the point?
You can have a macro run with AUTORUN or AUTOOPEN.
That way when someone opens the workbook the Macro will run.

So to have a workbook that will not open without marco you make a workbook that runs a macro on open.

You can protect and un-protect the workbook by the same macro if you do not want anyone messing with the options once it is open.

Then after that Protect -unprotect as needed.

Bit messy but may give you some ideas.

You could also simply AUTORUN a form that fills the whole screen, effectively blocking access to the workbook, then add some command buttons to the form.

Few Ideas.
 
Upvote 0
You use a Worksheet_Close event to hide ALL but one sheet ?
The Auto_Open event then reopens the hidden sheets, if the macros are disabled at start the sheets remain hidden.
Was that the information you were looking for ??
 
Upvote 0
Thx,

Your ideas allow to do the same thing I described but in different way. But the point of my quastion was "How I did it that macro was obligate". Unfortunatly I didn't save this sheet.

Best regards
 
Upvote 0
Thx,

Your ideas allow to do the same thing I described but in different way. But the point of my quastion was "How I did it that macro was obligate". Unfortunatly I didn't save this sheet.

Best regards

AUTO_OPEN does obligate the macro to run.
The macro runs Automatically when the workbook opens, before the user can do anything else.

Maybe you could explain the reason you want this.

Depending on how mischievous your users are or what level of competency they have, would depend on what kind of foolhardy method you use.

Cheers
 
Upvote 0
@Fishing: An Auto_Open macro only runs if the user enables macros.

@Bieli: See http://www.excelguru.ca/node/91

Ahh yes I see this now.

I have not been using it enough lately, just getting back into it.

The only problem I see with this is getting permissions from your network administrator if the computer is on a secure network.

Something to be taken into consideration if the file is to be deployed for others to use in a commercial or educational environment.

Though many years ago I worked in a government agency and the network guys didn't have an issue with me running scripts of any sort.

Cheers
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,848
Members
452,948
Latest member
UsmanAli786

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