Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2003 Userinterfaceonly Password Protection Problem
Hi,
I have developed applications in Excel 2000. From testing these applications in Excel 2003, it appears that the vba password protection userinterface only switch may work only when manipulating the activesheet. Here is simple code from a test workbook: For the Workbook_Open event: For Each Sh in ThisWorkbook.Worksheets Sh.Protect "YOURPASSWORD", userinterfaceonly:=True Next Sh In a module: Sub TestHide() Thisworkbook.Worksheets("Sheet1").Rows("5:5").Hidd en=True Thisworkbook.Worksheets("Sheet2").Rows("5:5").Hidd en=True End Sub This code will hide Row 5 of the respective sheets only when that sheet is active. For a non-active sheet, the following error is displayed: Run-time error '1004': Unable to set the Hidden property of the Range class Is this a known error? If so, does anyone have a more elegant workaround then simply activating each sheet for which you would like to manipulate with VBA code? Thanks in advance, Marc |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2003 Userinterfaceonly Password Protection Problem
Hi
I have test it on a 2003 machine and it is working for me -- Regards Ron de Bruin http://www.rondebruin.nl wrote in message oups.com... Hi, I have developed applications in Excel 2000. From testing these applications in Excel 2003, it appears that the vba password protection userinterface only switch may work only when manipulating the activesheet. Here is simple code from a test workbook: For the Workbook_Open event: For Each Sh in ThisWorkbook.Worksheets Sh.Protect "YOURPASSWORD", userinterfaceonly:=True Next Sh In a module: Sub TestHide() Thisworkbook.Worksheets("Sheet1").Rows("5:5").Hidd en=True Thisworkbook.Worksheets("Sheet2").Rows("5:5").Hidd en=True End Sub This code will hide Row 5 of the respective sheets only when that sheet is active. For a non-active sheet, the following error is displayed: Run-time error '1004': Unable to set the Hidden property of the Range class Is this a known error? If so, does anyone have a more elegant workaround then simply activating each sheet for which you would like to manipulate with VBA code? Thanks in advance, Marc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
password protection problem | Excel Discussion (Misc queries) | |||
UserInterfaceOnly & Password Protection | Excel Discussion (Misc queries) | |||
Password Protection Problem | Excel Discussion (Misc queries) | |||
question about worksheet protection using userinterfaceonly:=true | Excel Programming | |||
Protection UserInterfaceOnly reading Hidden Formulas | Excel Programming |