View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Andrew Lenczycki Andrew Lenczycki is offline
external usenet poster
 
Posts: 7
Default make sure macro be loaded without user intervention

You can do a couple of things:
1) set the Tools|Macro|Security... menu option in Excel
to Low (this will enable the running of macros ALL the
time - careful though, since this will run malicious
macros from nefarious sources as well). You could also
digitally sign your macro, which I believe will allow you
to change the security level to Medium.
2) In a VBA module, create a macro called "Sub
Auto_Open". Excel will automatically execute all code
within the Auto_open subroutine whenever the file is
opened. You can program within the Auto_open routine,
code that looks at the users login name by using
the "Application.UserName" function, which will give the
name of the current user. From there restrict who has
access to what. Also look up "UserAccessList" and
UserAccess Object" from within the Visual Basic Help
structure within Excel. To get to the VBA portion from
Excel, press the [Alt] + [F11] keys simultaneously.

Andrew Lenczycki
-----Original Message-----
i hv a code which protects selected columns according to

users' login name,
so that unautorized user can't edit on columns on which

he is not supposed
to.
there is a problem, user has to "enable" macro when he

opens the workbook.
If he disable the macro, then the whole protection dies

as there is no macro
to run to check login name and authorization.
anybody can advice?


.