【外部プログラムインクルード】


使用例

Dim objWshShell
Set objWshShell = WScript.CreateObject( "WScript.Shell" )
Call Include( objWshShell.CurrentDirectory & "\lib\StopWatch.vbs" )
 
Dim oStpWtch
Set oStpWtch = New StopWatch
 
oStpWtch.StartT
WScript.Sleep 1000
oStpWtch.StopT
MsgBox oStpWtch.ElapsedTime & "[s]" '⇒ 1[s]

' 外部プログラム インクルード関数
Function Include( _
	ByVal sOpenFilePath _
)
	Dim objFSO
	Dim objVbsFile
 
	Set objFSO = CreateObject( "Scripting.FileSystemObject" )
	Set objVbsFile = objFSO.OpenTextFile( sOpenFilePath )
 
	ExecuteGlobal objVbsFile.ReadAll()
	objVbsFile.Close
 
	Set objVbsFile = Nothing
	Set objFSO = Nothing
End Function
 

最終更新:2016年10月18日 03:15