Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    set MSO Scripting Library (2000 sr 1)

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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: set MSO Scripting Library (2000 sr 1)

    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.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: set MSO Scripting Library (2000 sr 1)

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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: set MSO Scripting Library (2000 sr 1)

    Sal,

    There are two things that catch my eye, but you will have to decide if they might cause problems:
    <UL><LI>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?
    <LI>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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •