- ©«¤l
- 122
- ¥DÃD
- 26
- ºëµØ
- 0
- ¿n¤À
- 148
- ÂI¦W
- 0
- §@·~¨t²Î
- windos10
- ³nÅ骩¥»
- office2016
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2021-7-8
- ³Ì«áµn¿ý
- 2023-8-28
|
¦^´_ 1# cowww
Function IsFileOpen(filePath As String) As Boolean
Dim fileNum As Integer
fileNum = FreeFile()
On Error Resume Next
Open filePath For Binary Access Read Write Lock Read Write As fileNum
If Err.Number <> 0 Then
IsFileOpen = True
End If
Close fileNum
On Error GoTo 0
End Function
Dim targetFilePath As String
targetFilePath = "\\shl-group.com\dept\MFMG\¹ï¥~³æ¦ì¶}©ñ¸ê®Æ\·|ij«Ç¼Ò¨ã°lÂܸê°T\«æ¥ó±M®×ª¬ºA°lÂÜ_v2_1.xlsm"
If IsFileOpen(targetFilePath) Then
' Àɮפw³Q¶}±Ò¡A°õ¦æ¥t¦s·sÀɪº°Ê§@
Dim currentDate As String
currentDate = Format(Date, "yyyymmdd") ' ¨ú±o·í¤Ñ¤é´Áªº¦r¦êªí¥Ü¡A¨Ò¦p¡G20230522
Dim newFileName As String
newFileName = "\\shl-group.com\dept\MFMG\¹ï¥~³æ¦ì¶}©ñ¸ê®Æ\·|ij«Ç¼Ò¨ã°lÂܸê°T\«æ¥ó±M®×ª¬ºA°lÂÜ_v2_1_" & currentDate & ".xlsm"
ThisWorkbook.SaveAs filename:=newFileName, WriteResPassword:="6112", ReadOnlyRecommended:=True
Else
ThisWorkbook.SaveAs filename:=targetFilePath, WriteResPassword:="6112", ReadOnlyRecommended:=True
End If
============================================================================================
Private Sub Workbook_Open()
'«ü©w07:45¶}©l°õ¦æ"full_calc"
Application.OnTime TimeValue("17:00:00"), "full_calc"
End Sub
´ú¸Õµo²{¤Wz¨â¬q»yªk¦n¹³·|³y¦¨"¹H¤Ï¦@¥Îì«h"ªº²§±`¥X²{
½Ð°Ý³oÓ°ÝÃD¦³¿ìªk¸Ñ¨M¶Ü?? |
|