From: avi on
Hello,

Is there a way that could prevent the user manually deleting an
OleObject (ActiveX) from the ActiveSheet?

Thanks
Avi
From: H�ctor Miguel on
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.


From: avi on
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

From: Peter T on
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" <aviben(a)bezeqint.net.il> wrote in message
news:0ba25c79-808e-46ec-be59-411d477d7ef4(a)b2g2000yqi.googlegroups.com...
> 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
>


From: avi on
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
 |  Next  |  Last
Pages: 1 2
Prev: Class Programming
Next: Pictures/Clipart