Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_Open
'Your code goes here ' ' End Sub This will fire the macro as soon as you open the workbook. Amit "Dick Johnson" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Dick Johnson" wrote in message ... 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macros for template | New Users to Excel | |||
Macros for the AR Aging Workbook template? | Excel Worksheet Functions | |||
Template with macros | Excel Discussion (Misc queries) | |||
Disable macros in template d/l from MS? | New Users to Excel | |||
Macros in a template | Excel Programming |