- Katılım
- 2 Mart 2005
- Mesajlar
- 2,960
- Excel Vers. ve Dili
-
ev: Ofis 2007- Win Xp
iş: Ofis 2010- Win Vista
Thisworkbooka
Class1
En üste
kırmızı kodlarda ynalış olan ne
Kod:
Dim eklenti() As New Class1
Private Sub Workbook_Open()
ReDim Preserve eklenti(1)
Set eklenti(1).eklenti = Excel.Application
Call SagTusEkle
Call WMB_Ekle
End Sub
Class1
En üste
Kod:
Public WithEvents eklenti As Application
Kod:
Private Sub eklenti_SheetActivate(ByVal Sh As Object)
On Error Resume Next
Dim AktWb As Workbook
Set AktWb = ActiveWorkbook
Dim AktSf As Worksheet
Set AktSf = ActiveSheet
'çalışma sayfası korumalı ise komutları silik yap
If AktSf.ProtectContents Then
Application.CommandBars("Cell").Controls("Sütun &Genişliği Cm").Enabled = False
Application.CommandBars("Cell").Controls("Satır Y&üksekliği Cm").Enabled = False
Application.CommandBars("Column").Controls("Sütun &Genişliği Cm").Enabled = False
Application.CommandBars("Row").Controls("Satır Y&üksekliği Cm").Enabled = False
Else
Application.CommandBars("Cell").Controls("Sütun &Genişliği Cm").Enabled = True
Application.CommandBars("Cell").Controls("Satır Y&üksekliği Cm").Enabled = True
Application.CommandBars("Column").Controls("Sütun &Genişliği Cm").Enabled = True
Application.CommandBars("Row").Controls("Satır Y&üksekliği Cm").Enabled = True
End If
'çalışma kitabından çıkmadan koruma konmuşsa sayfa değişince komutu silik gösterir
If AktWb.ProtectStructure = True Then
Application.CommandBars("Ply").Controls("Diğer Sayfaları Sil").Enabled = False
Else
Application.CommandBars("Ply").Controls("Diğer Sayfaları Sil").Enabled = True
End If
End Sub
Kod:
[color=red]
Private Sub eklenti_WorkbookActivate(ByVal Wb As Object)
On Error Resume Next
Dim AktWb As Workbook
Set AktWb = ActiveWorkbook
If AktWb.ProtectStructure = True Then
Application.CommandBars("Ply").Controls("Diğer Sayfaları Sil").Enabled = False
MsgBox AktWb.Name & " korumalıdır"
Else
MsgBox AktWb.Name & " korumalı değildir"
Application.CommandBars("Ply").Controls("Diğer Sayfaları Sil").Enabled = True
End If
End Sub
[/color]
Son düzenleme: