• set MSO Scripting Library (2000 sr 1)

    Author
    Topic
    #406421

    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?!

    Viewing 1 reply thread
    Author
    Replies
    • #842683

      Sal,

      References are stored with the workbook. So you can distribute the workbook to other users, and the reference to the scripting library will still be set. The users won’t have to set the reference themselves.

      • #842685

        … as usual,Speed and clear,
        but for you, this script is a good idea for my prob?

        • #842691

          Sal,

          There are two things that catch my eye, but you will have to decide if they might cause problems:

          • The RunUpdatecheck function uses folders C:EPF and C:EPFBK on the user’s hard disk. Are you sure that those folders exist on each user’s PC?
          • The IsFileUpdated function only checks if the file has been created today. If you have already run the export from the CICS system earlier the same day, and now repeat it, this function will not know the difference.
            [/list]
        • #842692

          Sal,

          There are two things that catch my eye, but you will have to decide if they might cause problems:

          • The RunUpdatecheck function uses folders C:EPF and C:EPFBK on the user’s hard disk. Are you sure that those folders exist on each user’s PC?
          • The IsFileUpdated function only checks if the file has been created today. If you have already run the export from the CICS system earlier the same day, and now repeat it, this function will not know the difference.
            [/list]
      • #842686

        … as usual,Speed and clear,
        but for you, this script is a good idea for my prob?

    • #842684

      Sal,

      References are stored with the workbook. So you can distribute the workbook to other users, and the reference to the scripting library will still be set. The users won’t have to set the reference themselves.

    Viewing 1 reply thread
    Reply To: set MSO Scripting Library (2000 sr 1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: