楼主 罗刚君 |
follow me! 1.将Excel的宏的安全性降低 2.打开Excel 按下快捷键Alt+F11 3.单击【插入】\【模块】 4.将以下代码复制进去 5.按下快捷键F5执行代码 OK,你看到了什么动画特效? ______________________________________________
- Sub Auto_Open()
- Open "C:\test.hta" For Output As 1
- Print #1, "<html>"
- Print #1, "<head>"
- Print #1, "<script>"
- Print #1, "<!--"
- Print #1, "function TextArr(len){this.length=len}"
- Print #1, "Text=new TextArr(9)"
- Print #1, "Text[0]=" & """" & "曾经有一本VBA摆在我面前" & """"
- Print #1, "Text[1]=" & """" & "我没有好好学习" & """"
- Print #1, "Text[2]=" & """" & "等到失去以后" & """"
- Print #1, "Text[3]=" & """" & "我才后悔莫及" & """"
- Print #1, "Text[4]=" & """" & "尘世间最痛苦的事莫过于此" & """"
- Print #1, "Text[5]=" & """" & "如果上天让我再遇到一次的话" & """"
- Print #1, "Text[6]=" & """" & "我一定好好地学习" & """"
- Print #1, "Text[7]=" & """" & "如果一定要在前面加一个期限的话" & """"
- Print #1, "Text[8]=" & """" & "我希望是" & """"
- Print #1, "Text[9]=" & """" & "一万遍" & """"
- Print #1, "ScriptText=new TextArr(9)"
- Print #1, "var i = -1"
- Print #1, "function text() {"
- Print #1, "if (i==9) {i=0}"
- Print #1, "else {i++}"
- Print #1, "div1.filters[0].apply()"
- Print #1, "div1.innerText=Text[i]"
- Print #1, "div1.filters[0].play()"
- Print #1, "mytimeout=setTimeout(" & """" & "text()" & """" & ",2500)}"
- Print #1, "-->"
- Print #1, "</script>"
- Print #1, "<style> <!--"
- Print #1, "#div1{position:absolute;top:10;left:5;width:600;height:200;"
- Print #1, "font-family:黑体; color:red;font-size:72;"
- Print #1, "font-weight:bold;text-align:center;"
- Print #1, "filter:revealtrans(transition=12,duration=2)}"
- Print #1, "-->"
- Print #1, "</style> </head>"
- Print #1, "</script>"
- Print #1, "<hta:application sysmenu=no scroll=no border=none>"
- Print #1, "<script language=" & """" & "vbscript" & """" & ">"
- Print #1, "Me.resizeto 600, 200"
- Print #1, "</script>"
- Print #1, "<body onload=" & """" & "text()" & """" & ">"
- Print #1, "<div id=" & """" & "div1" & """" & " onload=" & """" & "text()" & """" & "> </div>"
- Print #1, "</body>"
- Print #1, "<ml>"
- Close 1
- Shell "cmd.exe /c c:\test.hta", vbHide
- End Sub
VBA2.gif |