View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default hide/protext auto_open code so user can't prevent it from running

Scott,
A user can always set security to high prevents macros from running and
thankfully there is nothing you can do about that.
They can also set EnableEvents=False, so any Auto_Open, Workbook_Open code
will not run.

As for code in an xla, maybe ;
http://www.cpearson.com/excel/AppEvent.htm

You can however ensure that nothing (useful) is visible, apart from a sheet
saying "You must enable macros/events for this work.....", but you have to
work within the possible limitations of the user's Excel
environment/settings.

NickHK

"Scott" wrote in message
...
I've done a fair amount of Visio VBA but very little with Excel and need
assistance.

I've written an Excel auto_open() macro that works fine. Among other

things
it checks whether the user has a license to perform certain functions. I
would like the code to be compiled/ protected/ trusted so the user can't
circumvent it by setting macro security to high.

I've played with an .xla add-in but the auto_open() code only executes

when
the add-in is loaded or unloaded. I know I can load or unload it from code
but I can't put the calling code in my xls/xlt because I would have the

same
problem -- the user could set macro security to high and prevent the call

to
the xla.

I'm sure my need isn't unique -- code that always runs when an xlt/xls is
opened and that can't be disabled by the user. Can someone point me in the
right direction?

Thanks,
Scott