Public Sub Imports( ByVal fullFileNameStr )
Const ForReading = 1
Dim oFileDim
ReadAllTextFile
On Error Goto 0
If fullFileNameStr = vbNullstring Then
Reporter.ReportEvent micFail, “FileNotFoundException”, “Unable to find the specified file: ” & libName
Exit Sub
End If
Set oFile = FsoUtil.OpenTextFile( fullFileNameStr, ForReading )
ReadAllTextFile = oFile.ReadAll()
oFile.Close : Set oFile = Nothing
‘ ** Executing the text, to load file to memory.
ExecuteGlobal( ReadAllTextFile )
End Sub
Call the function as the follows
Imports “C:\Automation\MyFile.vbs”
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment