Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to protect all of the sheets in my AddIn before I release it, but I
don't want them to be protected while I'm doing development. Is there any way to protect the sheets when the AddIn is loaded, or at some other time? I'm using Excel 97... :) Jon |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why do you not just password protect the addin?
Or create a simple macro to protect the sheets and unprotect whe working on them. i.e place an admin macro in the addin so its locked when others use i but when you need to ammend something you can click admin and put th password in which then unlock the sheets. Below is some code which may help you, or you can use a simple cod also below <=====Code that i have found======= Sub modMenu_Administer() On Error GoTo err_modMenu_Administer 'vars Dim strTemp As String 'code strTemp = InputBox("Please enter password to unlock thi workbook") If strTemp = sysCurrentPW Then sysUnlockWorkbook Else If strTemp < "" Then MsgBox "Password incorrect" End If End If 'gotos exit_modMenu_Administer: Exit Sub err_modMenu_Administer: MsgBox Err & " - " & Error() Resume exit_modMenu_Administer End Sub Sub sysLockWorkbook() On Error GoTo err_LockWorkbook 'vars 'code Sheets("Personal Details").Protect sysCurrentPW Sheets("Log").Protect sysCurrentPW Sheets("System").Visible = False Sheets("modSystem").Visible = False Sheets("modMenu").Visible = False Sheets("modDetails").Visible = False Sheets("frmDetails").Visible = False Sheets("modLog").Visible = False Sheets("frmLog").Visible = False Sheets("Lists").Visible = False Sheets("frmPrint").Visible = False Sheets("modPrint").Visible = False Sheets("modOutput").Visible = False Sheets("frmOutput").Visible = False Sheets("tmpLog").Visible = False sysMenusVisible False sysToolBarsVisible False 'gotos exit_LockWorkbook: Exit Sub err_LockWorkbook: MsgBox Err & " - " & Error() Resume exit_LockWorkbook Resume End Sub Sub sysUnlockWorkbook() On Error GoTo err_UnlockWorkbook 'vars Dim objToolbar As Object 'code Sheets("Personal Details").Unprotect sysCurrentPW Sheets("Log").Unprotect sysCurrentPW Sheets("System").Visible = True Sheets("modSystem").Visible = True Sheets("modMenu").Visible = True Sheets("modDetails").Visible = True Sheets("frmDetails").Visible = True Sheets("modLog").Visible = True Sheets("frmLog").Visible = True Sheets("Lists").Visible = True Sheets("frmPrint").Visible = True Sheets("modPrint").Visible = True Sheets("modOutput").Visible = True Sheets("frmOutput").Visible = True Sheets("tmpLog").Visible = True sysMenusVisible True sysToolBarsVisible True 'gotos exit_UnlockWorkbook: Exit Sub err_UnlockWorkbook: MsgBox Err & " - " & Error() Resume exit_UnlockWorkbook End Su -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect sheets in one go | Excel Discussion (Misc queries) | |||
Protect some sheets in an xls but not all. | Excel Worksheet Functions | |||
Protect-Unprotect all the sheets | Excel Worksheet Functions | |||
Protect all Sheets | Excel Discussion (Misc queries) | |||
Protect a few sheets | Excel Programming |