06/11/09 11:25:29
<?xml version="1.0" encoding="shift_jis"?>
<package>
<component>
<public>
<method name="CreateObject" dispid="0" internalName="xCreateObject" />
</public>
<script language="VBScript"><![CDATA[
Option Explicit
Public Function xCreateObject(ProgID)
Set xCreateObject=CreateObject(ProgID)
End Function
']]></script>
</component>
</package>
というWSCを作って、
<html><head><script language="VBScript">
Sub window_onload()
Set xCreateObject=GetObject("script:" & location.pathname & "\..\CreateObject.WSC")
Set Stream=xCreateObject("ADODB.Stream")
MsgBox TypeName(Stream)
Stream.Open
Stream.Type=2
Stream.Charset="shift_jis"
Stream.LoadFromFile location.pathname
MsgBox Stream.ReadText(-1)
End Sub
</script></head><body></body></html>
てな具合にWSCでCreateObjectさせるとエラーにならないですよ。