tạo form đặt pass trong word

Liên hệ QC

tamnguoiban

Thành viên mới
Tham gia
14/5/09
Bài viết
4
Được thích
0
+-+-+-+
Em đang lập một form để đặt pass cho word nhưng không thể chạy được

Nhờ các anh chị cao thủ trong diễn đàn chỉnh sửa lại đoạn code này giúp em với

Em cảm ơn nhiều
Private Sub Label1_Click()
End Sub
Private Sub Label3_Click()
End Sub
Private Sub LabelProgress_Click()
End Sub
Private Sub OkBut_Click()
On Error Resume Next
If PasswordTextBox.Text = Pwd And userCombo = Usr Then
Me.Height = 162
Main
Else
MsgBox "Khong dung Password!", vbCritical + vbInformation, "Thong bao"
Thoat
End If
End Sub
Private Sub Thoat()
On Error Resume Next
Application.Quit
End Sub
Private Sub PasswordTextBox_Change()
End Sub
Private Sub UserCombo_Change()
End Sub
Private Sub UserForm_Initialize()
On Error Resume Next
Me.Height = 115
Me.userCombo.SetFocus
End Sub
Sub Main()
On Error Resume Next
Application.ScreenUpdating = False
books.Add.Name = "TT"
Dim Counter As Integer
Dim RowMax As Integer, ColMax As Integer
Dim r As Integer, c As Integer
Dim PctDone As Single
If TypeName(Activebook) <> "worksbook" Then Exit Sub
Cells.Clear
Application.ScreenUpdating = False
Counter = 1
RowMax = 1300
ColMax = 25
For r = 1 To RowMax
For c = 1 To ColMax
Cells(r, c) = Int(Rnd * 1300)
Counter = Counter + 1
Next c
PctDone = Counter / (RowMax * ColMax)
With UsersName
.FrameProgress.Caption = Format(PctDone, "0%")
.LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
End With
DoEvents
Next r
books("TT").Select
Application.DisplayAlerts = False
ActiveWindow.Selectedworksbook.Delete
Unload UsersName
End Sub
 
Web KT

Bài viết mới nhất

Back
Top Bottom