ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

ÀˬdÀɮ׬O§_¦s¦b

½Ð°Ýµ{¦¡¦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
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD