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

[µo°Ý] ¹H¤Ï¦@¥Î­ì«h

¦^´_ 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²{¤W­z¨â¬q»yªk¦n¹³·|³y¦¨"¹H¤Ï¦@¥Î­ì«h"ªº²§±`¥X²{

½Ð°Ý³o­Ó°ÝÃD¦³¿ìªk¸Ñ¨M¶Ü??

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD