ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protect - Unprotect from ActiveX Control (https://www.excelbanter.com/excel-programming/298631-protect-unprotect-activex-control.html)

Nigel[_8_]

Protect - Unprotect from ActiveX Control
 
Hi All
I have piece of code that simply unprotects a worksheet, manipulates the
sheet contents and re-protects the same sheet. This works fine if run from
a workbook module. I then add a ActiveX control button to the sheet, and
assign the code to this button through the click-event. I have tried
putting the code directly into the event and calling the code from the
module but both fail.

I rarely use controls on sheets but do recall seeing some references to
specfic issues that may be the cause of my difficulties. Can anyone shed
any light on this? TIA

Cheers
Nigel



Tim Zych[_8_]

Protect - Unprotect from ActiveX Control
 
Set the TakeFocusOnClick property of the button to FALSE if using XL97.
Or possibly ActiveCell.Select just before the code that is causing the
error.

"Nigel" wrote in message
...
Hi All
I have piece of code that simply unprotects a worksheet, manipulates the
sheet contents and re-protects the same sheet. This works fine if run

from
a workbook module. I then add a ActiveX control button to the sheet, and
assign the code to this button through the click-event. I have tried
putting the code directly into the event and calling the code from the
module but both fail.

I rarely use controls on sheets but do recall seeing some references to
specfic issues that may be the cause of my difficulties. Can anyone shed
any light on this? TIA

Cheers
Nigel






All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com