Accepting macros

R

routeram

Hello,

I have been reading posts in the newsgroups about forcing (well no
actually possible, I know) the user to accept macros - suggestion
offered included making the worksheet less useable when macros wer
disabled.

One popular suggestion was to have a warning sheet asking the user t
enable macros if the user hadn't enabled macros. This would requir
that such a sheet be created and made 'very hidden' in th
workbook_open event and finally made visible in workbook_beforeclos
event and SAVE the workbook. The problem with this method is that th
workbook is saved everytime it is closed which may not be desirable fo
the user. Is there anyway to get around this method?

Another suggestion offered was to use a dummy workbook to actually ope
another workbook. Would this be able to solve my problem? If yes, coul
anybody please shed some more light on how to go about doing it? An
would there be 2 workbooks visible to the user in the directory? (agai
not desirable cos user may not for sure know which one should be used)

My workbook is intended for students and so I wouldn't accept them t
be too knowledgeable about the intricacies of Excel. So I am not reall
looking for a full proof remedy, just a simple way which will work unde
'normal conditions'.

Thank you for patient reading.

Regards,
Ra
 
J

jeff

Hi, Ram,

I may not be understanding your problem fully, but it
sounds like you want a gentle way to (sometimes?) force
students to enable macros in order to run/work on your
workbooks.

Without getting too complicated, I'd simply add a
"Cover sheet" which states that the workbook is not
enabled and that the user should enable macros when
opening. All the other sheets would be hidden, so
they can't get to them. Protect the sheets and workbook
so they cannot select anything.

If macros are enabled upon openning, then run an automatic
macro that unhides those hidden worksheets. (also use a
macro to re-hide them when closing/saving.)

Not foolproof, but maybe it'd work??

jeff
 
R

routeram

Hi Jeff,

Thanks for your reply. Lets say, macros were accepted and the studen
saved the workbook after reaching a stage. Now, the student di
something wrong (some cells can be changed) and messed up th
calculations. He now wants to close and open the workbook again WITHOU
saving so that he can come back to where he was. This would not b
possible since I will have to save the workbook each time I close afte
hiding the relevant sheets. ( I have to save after hiding the sheet
which will save the full workbook which the student won't want ... ge
it? )

Thanks again for your helping hand!

Regards,
Ram
 
R

routeram

Hi,

Can somebody help me with this? It has been quite a while since
started thinking on this.

Thanks.

Ra
 
D

Dave Peterson

I think I like the dummy workbook that opens the real workbook. If macros are
disabled, then the user sees a screen that says: Please close this workbook and
reopen it with macros enabled.

If macros are enabled, you can hide that sheet (or just scroll down to hide the
range with the message), open the real workbook, and close the dummy workbook.

The users might see a flash when things work the way you want.

The dummy macro could look something like:

Option Explicit
Sub auto_open()
application.goto worksheets("sheet1").range("Iv65536"), scroll:=true
Workbooks.Open Filename:="c:\my documents\excel\book1.xls"
ThisWorkbook.Close savechanges:=False
End Sub

When you're testing, save first. When it runs, it closes itself without saving!
 
Top