Macros in Template

D

Dick Johnson

Hi all,

I have developed a template form to collect data. The data
after being entered on the form it is stored on additional
sheets within the workbook for collect later.

I have written & stored 2 marcos within the workbook. One
protects the sheet from users selecting locked cells &
hides the additional sheets in the workbook. The other
unprotects the sheet & unhides the additional sheets.

I have saved the template after using the 'Protect' marco.

My problem is this:

When the template is opened as a new workbook the locked
cells are available to the user. I can still manually
activate the 'Protect' macro to block access to the locked
cells.

Is there something Im doing wrong in the 'set-up'
or 'programing'? or
Can a macro be set to activate when a new workbook is
opened?

Thanks for any assitance on this matter.

Dick Johnson
 
A

Amit Shanker

Private Sub Workbook_Open
'Your code goes here
'
'
End Sub

This will fire the macro as soon as you open the workbook.

Amit
 
D

Dick Johnson

Thanks Amit, problem solved
-----Original Message-----
Private Sub Workbook_Open
'Your code goes here
'
'
End Sub

This will fire the macro as soon as you open the workbook.

Amit





.
 
Top