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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
Not sure to understand your remark
You've asked to know how can a user select an OleObject without being in Design Mode I therefore presented the code that enables to create an event (in my case a simple Click on the object) that makes the object selectable (Anchors at its corners) Please try rephrasing your question in case I didn't understand it Thanks Avi |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
I know it's possible to select oleObjects with code, but no need even to
select. This will delete them all - ActiveSheet.OLEObjects.Delete My question to you was how to select an oleObject without being in design mode or without using *code*. In your reply to Hector you were talking about what the "user" can do, which normally means manually. Have you tried protecting the sheet as I suggested, you only need to protect Objects. As I said not very secure, but nothing in Excel is totally secure Regards, Peter T "avi" wrote in message ... Not sure to understand your remark You've asked to know how can a user select an OleObject without being in Design Mode I therefore presented the code that enables to create an event (in my case a simple Click on the object) that makes the object selectable (Anchors at its corners) Please try rephrasing your question in case I didn't understand it Thanks Avi |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
Thanks
Protecting objects in the sheet seems indeed a good way to achieve what I need Avi |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObject-Preventing deletion
hi, avi !
Protecting objects in the sheet seems indeed a good way to achieve what I need this is part of your original post regarding (*manually* was very precise)... " ... prevent the user manually deleting an OleObject (ActiveX) ..." and, this is what a first suggested... " ... beside protecting that worksheet ..." hth, hector. |
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 |