Menu

Rabu, 25 Maret 2015

Membuat Tombol close (X) worksheet gak berfungsi di Excel dengan VB

Nah untuk membuat Tombol close (X) worksheet gak berfungsi bisa coba memasukkan scrib ini pada 

Thisworkbook

Public myFlg As Boolean
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Letakkan ini pada "ThisWorkbook"
If myFlg = True Then Exit Sub
Application.DisplayAlerts = False
Cancel = True
End Sub
Sub myClose()
myFlg = True
Application.DisplayAlerts = False
ActiveWindow.Close False
End Sub

1 komentar:

  1. Ass..Mas Fatho Rahman, sy ingin tanya ne Mas.. kalou tombol X (Close) di UserForm VBA kita rubah langsung menjadi tombol Quit Aplikasi excel, itu gmn caranya mas.. terima kasih..

    BalasHapus