- ©«¤l
- 472
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 485
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- MS Office
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-7-4
- ³Ì«áµn¿ý
- 2014-12-28
|
½Ð°Ýµ{¦¡¦p¦ó¥HIF ¥hÀˬd
ÀÉ®×TEST.XLS ¬O§_¦s¦b©ó C:\
¤Î
ÀÉ®× TEST1.XLS ¬O§_¤w¶}±Ò
½Ð«ü±Ð
enoch µoªí©ó 2011-7-27 14:13
³oÓ¥i¬d¤£¦PEXCEL¶iµ{
°Ñ¦Ò: http://support.microsoft.com/kb/209189/zh-tw
Sub test()
Dim result As Integer
result = FileLocked("C:\TEST.XLS")
Select Case result
Case Is = 76
MsgBox ("¸ô®|¤£¦s¦b¡C")
Case Is = 75
MsgBox ("¤å¥ó¤£¦s¦b¡C")
Case Is = 70
MsgBox ("Àɮפw¶}±Ò")
Case Is = 0
MsgBox ("ÀÉ®×¥¿±`")
Case Else
MsgBox ("Àɮצ³¤£©ú°ÝÃD")
End Select
End Sub
Function FileLocked(strFileName As String) As Integer
On Error Resume Next
Open strFileName For Binary Access Read Write Lock Read Write As #1
Close #1
FileLocked = Err.Number
If Err.Number <> 0 Then
Err.Clear
End If
End Function |
|