Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
Hello,
Is there a way that could prevent the user manually deleting an OleObject (ActiveX) from the ActiveSheet? Thanks Avi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
hi, !
Is there a way that could prevent the user manually deleting an OleObject (ActiveX) from the ActiveSheet? AFAIK embedded ActiveX objects requires excel/vba in "design mode" for the user could "manually" select & delete'em so, beside protecting that worksheet, you need some vba like the following: put this in ThisWorkbook code-module: Private Sub Workbook_Open() Design_Mode False End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Design_Mode End Sub and this in a standard code-module: Option Private Module Sub Design_Mode(Optional On_Off As Boolean = True) Dim cBar As CommandBar On Error Resume Next For Each cBar In Application.CommandBars cBar.FindControl(Id:=1605, Recursive:=True).Enabled = On_Off Next End Sub hth, hector. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
Thanks, but actually there is a way to select the activeX without
being in Design mode. It is one of the available methods for OleObjects Selecting th object enales the user to drag it, resize it and delete it. I'm looking for away to prevent deleting Thanks Avi |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
Please describe how a user can select an OLEObject / embedded ActiveX
without being in Design mode or using code. You could protect objects on the sheet which would prevent deletion, though as I'm sure you are aware sheet/workbook protection is not very secure. Regards, Peter T "avi" wrote in message ... Thanks, but actually there is a way to select the activeX without being in Design mode. It is one of the available methods for OleObjects Selecting th object enales the user to drag it, resize it and delete it. I'm looking for away to prevent deleting Thanks Avi |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
Here is how I do it:
For Each G In xlapp.ActiveSheet.OLEObjects If TypeName(G.Object) = "SSlider" Then MySliders.Add G Next For i = 1 To MySliders.Count If MySliders(i).Name = IndicatorSpecificName Then Ind = i End If Next MySliders(Ind).Select Avi |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
I don't follow, "Here is how I do it". Is that intended as an answer to my
question to you (it's not), or as an answer to something else, or for general information, or a question about something else. Regards, Peter T "avi" wrote in message ... Here is how I do it: For Each G In xlapp.ActiveSheet.OLEObjects If TypeName(G.Object) = "SSlider" Then MySliders.Add G Next For i = 1 To MySliders.Count If MySliders(i).Name = IndicatorSpecificName Then Ind = i End If Next MySliders(Ind).Select Avi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Preventing sheet deletion | Excel Programming | |||
preventing deletion of a comment | Excel Discussion (Misc queries) | |||
preventing formula deletion | Excel Discussion (Misc queries) | |||
Preventing deletion. | Excel Discussion (Misc queries) | |||
Preventing deletion of a custom toolbar | Excel Programming |