''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '' Function ExecGlobal( strCodeFile ) '' Author: ebgreen '' Purpose: Imports a class that is stored in an external file. '' Takes: strCodeFile - The name of the file with the class To '' import. Must be a valid path. '' Returns: Array - (0)= The return code. 0 means success otherwise '' it will be the error code returned by '' the operation that failed. '' (1)= Any error message. Will be "" if success '' Modified: 24.05.2009 by Nic ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function ExecGlobal(strCodeFile) Dim oFile, strFile strFile = shell.CurrentDirectory & "\" & strCodeFile 'Check to see if the file to be loaded exists. If it does not, return an error If Not fso.FileExists(strFile) Then ExecGlobal = Array("1", "The specified class file " _ & strFile & " does not exist") Exit Function End If On Error Resume Next Err.Clear 'Open the file to be loaded. If the open fails, return an error. Set oFile = fso.OpenTextFile(strFile) If Err.Number <> 0 Then ExecGlobal = Array(Err.Number, _ "The specified class file " & strFile _ & " could not be opened for reading.") Exit Function End If On Error GoTo 0 'The file object is created so read all of the file and execute it globally to load the class for use strFile = oFile.ReadAll oFile.close Set oFile = Nothing ExecuteGlobal strFile ExecGlobal = Array("0", "") End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''