MrExcel Publishing
Your One Stop for Excel Tips & Solutions


Posted by M Walker on July 03, 2001 2:38 AM

I'm a complete beginer at writing macros and need some help.

Ideally i wouild like a macro that runs when the workbook is accessed. This would involve the user being confronted with a userform rather than the workbook its self. The user would then use the forms rather than have access to the spreadsheets (i would like to reduce access to the information on the sheets and introduce a password to edit them - eventually)

I've desgined the sheets and know what i'd like them to do, but i am at a loss as to how i can automatically run the userforms when the workbook is accessed.

Any help would be very much appreciated

Thanks in advance,

M Walker

Posted by zen on July 03, 2001 6:11 AM

I just might have a hugh starting point for you, i've just had a lot of help re: a form which sounds like it fits your requirements. Users have no access to excel from start to finish (except the input forms) and it can be easily edited by yourself. i'm no good at vba myself but as i said it's starting point. you can e.mail with the kinda thing you need and i'll give you a place to start (and i do mean just a place to start).


Posted by Cory on July 03, 2001 6:46 AM

Try this:

When you go into VBE and can see the list of worksheets in the Project Explorer on the left, at the bottom of this list you'll see on named "This Workbook". Right-click on this and select "View Code". You should be in the workbook_activate code module. Enter in the following code:


Where "Userform1" is the name of the form you want to show at start up. Then if you want Excel to minimze leaving only your form add this right underneath:

Application.Windowstate = xlMinimized


Posted by zen on July 03, 2001 4:12 PM

sorry forgot ot put my e.mail address

Posted by Montgomery on July 06, 2001 11:13 AM

I have a similar problem, except that i have created a user form on one of my most simple worksheets. I would also only like the users to see the form but i am still seeing my sheet in the background. Maybe you can give a start as well.