for the wizard HansV,
Sub GetFile()
Do Until RunUpdateChk = True
DoEvents
Loop
‘FILE IS NOW UPDATED, READY FOR USE
Call IMPORT_L0785
End Sub
Function RunUpdateChk() As Boolean
‘First see if file is updated if it is then check
‘to see if it’s locked (being updated). Msgbox end result
If IsFileUpdated(“C:EPFL0785.EPF”) Then
If IsFileLock(“C:EPFL0785.EPF”, “C:EPFBK”) Then
Else
RunUpdateChk = True
End If
End If
End Function
Function IsFileUpdated(strFilePath$) As Boolean
‘Check to see if file was updated today
Dim fs As New FileSystemObject, fil As File
Set fil = fs.GetFile(strFilePath)
If DateValue(fil.DateCreated) = Date Then IsFileUpdated = True
End Function
Function IsFileLock(strFilePath$, strTmpPath$) As Boolean
‘Need reference to the Microsoft Scripting Run-time
Dim fs As New FileSystemObject
Dim fil As File, strTmp$
Set fil = fs.GetFile(strFilePath)
strTmp = fil.Path
On Error Resume Next
fil.Move strTmpPath
If Err 0 Then IsFileLock = True
fil.Move strTmp
End Function
my dear you remember my old prob to “know when the jpb of printer is finished…” well, i have finded this script and on my wbook work well (i have setting manually the librarary MSO Scripting Library because to the default this is not setting), my dubt is:
(in the comment of this script is raccomanded to run the script after to have set in preference “MSO Scripting Library….” )
If i distribute this WBook to the another user and it not have set to the default the “MSO Scripting Library” the script go in error or not?!