In "This Workbook" of your VBA project
Private Sub Workbook_Open()
Module1.YourMacro
End Sub
reference what ever worksheet or module it is in
What do you mean by protect your macro?
if you want to prevent someone from seeing your code then right click on your
project in the Project viewer, select the Protection tab, check "Lock project
for viewing", and enter a password.
Daniel wrote:
Hi
How can I protect my macro program? I created a bar chart with macro for a
workgroup, members need to run the macro to paint the chart manually by
Tool/macro/ run.
It is best if I can make it run automatically when member open the
worksheet, but
I don't know how?
Thanks
Daniel
--
Message posted via
http://www.officekb.com