¦p¦ó§PÂ_ server ¤Wªº excel Àɮ׳Q¶}±Ò
- ©«¤l
- 29
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXP
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-3-2
- ³Ì«áµn¿ý
- 2015-6-1
|
¦p¦ó§PÂ_ server ¤Wªº excel Àɮ׳Q¶}±Ò
¦³¤H¥i¥H¸Ñµª¤@¤U, n¦p¦ó§PÂ_ server ¤Wªº excel Àɮ׳Q¶}±Ò
ì¦]¬O¦]¬°¦p server ¤Wªº excel³Q§O¤H¶}±Ò«á,
n§PÂ_¬O§_¯à±N¸ê®Æ¦s¤J¨ì server ¤Wªº excel ÀÉ®×
Y³Q§O¤H¶}±Ò, «h¸õ¥X message ³qª¾ Àɮפv³Q¶}±Ò, ¨Ã©ñ±ó¦sÀÉ
excel VBA ¥i¥H°µªº¨ì¶Ü? |
|
|
|
|
|
|
- ©«¤l
- 29
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXP
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-3-2
- ³Ì«áµn¿ý
- 2015-6-1
|
¦^´_ 3# GBKEE
·Q½Ð°Ý GBKEE ª©¥D
©³¤U¦³¨Ç¤£¤ÓÀ´, ¥i¥H¸Ñµª¤@¤U¶Ü
Sub SetAttribue()
Dim strFile As String
strFile = "c:\temp\test.xlsx"
If Not IsWorkBookOpen(strFile) Then
SetAttr strFile, vbReadOnly ' ¤£¤ÓÀ´³oÃ䪺·N«ä
MsgBox "file now readonly"
Else
MsgBox "File is already open"
End If
End Sub
Function IsWorkBookOpen(FileName As String) As Boolean
Dim ff As Long
Dim ErrNo As Long
On Error Resume Next
ff = FreeFile() ' ¤£À´»yªk
Open FileName For Input Lock Read As #ff ' ¤£À´ #ff ·N«ä
Close ff
ErrNo = Err
On Error GoTo 0
Select Case ErrNo
Case 0: IsWorkBookOpen = False
Case 70: IsWorkBookOpen = True
Case Else: Error ErrNo
End Select |
|
|
|
|
|
|
- ©«¤l
- 29
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXP
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-3-2
- ³Ì«áµn¿ý
- 2015-6-1
|
¦^´_ 2# diolin
§Úª¾¹D¥i¥H¶}ªº°_¨Ó, ¦ý³Q§O¤H¶}±Ò«á§Ú¤Sn¦sÀÉ´N·|¦³°ÝÃD°Ú
©Ò¥H¤~n¤@¶}±ÒÀÉ®×,´N§PÂ_Àɮ׬O§_³Q§O¤H¶}±Ò
³o¹ï¦h¤H¥i¯à¦P®É¨Ï¥Î¤@ÓÀÉ®×, ¦³«Ü¤jªºÃö«Y |
|
|
|
|
|
|
- ©«¤l
- 29
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXP
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-3-2
- ³Ì«áµn¿ý
- 2015-6-1
|
·Q½Ð°Ý GBKEE ª©¥D
©³¤U¦³¨Ç¤£¤ÓÀ´, ¥i¥H¸Ñµª¤@¤U¶Ü
Sub SetAttribue()
Dim strFile As String
strFile = "c:\temp\test.xlsx"
If Not IsWorkBookOpen(strFile) Then
SetAttr strFile, vbReadOnly ' ¤£¤ÓÀ´³oÃ䪺·N«ä
MsgBox "file now readonly"
Else
MsgBox "File is already open"
End If
End Sub
Function IsWorkBookOpen(FileName As String) As Boolean
Dim ff As Long
Dim ErrNo As Long
On Error Resume Next
ff = FreeFile() ' ¤£À´»yªk
Open FileName For Input Lock Read As #ff ' ¤£À´ #ff ·N«ä
Close ff
ErrNo = Err
On Error GoTo 0
Select Case ErrNo
Case 0: IsWorkBookOpen = False
Case 70: IsWorkBookOpen = True
Case Else: Error ErrNo
End Select
End Function |
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2011-11-10
- ³Ì«áµn¿ý
- 2019-2-27
|
¥Ø«e쥻´N·|¦Û°Ê´N·|§PÂ_§r , ¦pªG¦³¤H¶}±Ò, ´N¥u¯à¥Î°ßŪ¥´¶}
¦pªGn¦Û¤v¥´³y, ´N²£¥ÍÓ lock file ¥h¨Ñ§PÂ_´N¦n¤F |
|
|
|
|
|
|