I am new to using x10 and I am trying to send simple lamp module on/off commands using the CM15A with a power point VBA macro. I'm trying to translate the VBscript code below to a VBA macro and I'm having trouble. was wondering if anyone knew how to translate this to a simple macro to execute the on/off when the macro runs?
Thanks.
VRYNH
<HTML>
<HEAD>
<TITLE>ActiveHome VB Scripting</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" >
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<CENTER><H2>ActiveHome VB Scripting</H2></CENTER>
<FONT FACE="verdana,arial,helvetica" SIZE=1>
<A href="#" onclick=self.close() CLASS="clsDemo">Close This Test</A>
</FONT><HR>
<OBJECT ID="ActiveHome1" width=0 height=0
classid="CLSID:001000AF-2DEF-0208-10B6-DC5BA692C858"
codebase="ahscript.dll"
standby="Loading X10 net components..."
type="application/x-oleobject">
</OBJECT>
<FORM NAME="myForm">
Send Status
<BR>
<INPUT TYPE="text" NAME="sendstatus" size="50">
</FORM>
<SCRIPT LANGUAGE="vbscript">
Function doCommand( Command )
if Command = 1 then
myForm.sendstatus.value = "e8 On sent"
ActiveHome1.SendAction "sendplc", "e8 on"
elseif Command = 2 then
myForm.sendstatus.value = "e8 Off sent"
ActiveHome1.SendAction "sendplc", "e8 off"
end if
End Function
</SCRIPT>
<FORM NAME="myButtons">
<BR>
<CENTER>
<INPUT NAME="btnSendOn" TYPE="Button" VALUE="Send e8 on" onclick="doCommand( 1 );">
<INPUT NAME="btnSendOff" TYPE="Button" VALUE="Send e8 off" onclick="doCommand( 2 );">
</CENTER>
<BR>
</FORM>
<P>
<HR>
<FONT FACE="Arial" SIZE="1" COLOR="BLACK">
© 2004 <A TARGET="_blank" HREF="
http://www.x10.com">X10</A>. All rights reserved.
</FONT>
</BODY>
</HTML>