- 帖子
- 99
- 主題
- 15
- 精華
- 0
- 積分
- 164
- 點名
- 0
- 作業系統
- WIN7
- 軟體版本
- office2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2017-5-30
- 最後登錄
- 2024-10-5
|
之前在某個網站上看到有人分享的 所以也不吝嗇給大家
程式碼如下:
Option Explicit
Sub auto_open()
addhtmlobj (CStr(Sheet1.Range("A1")))
End Sub
Sub addhtmlobj(newstr As String)
Dim fs, a, fn
fn = ThisWorkbook.Path & "\x.htm"
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(fn)
a.WriteLine ("<body scroll=""no"" topmargin=""0"" leftmargin=""0""><marquee>" & _
newstr & "</marquee></body>")
a.Close
Sheet1.WebBrowser1.Navigate ThisWorkbook.Path & "\x.htm"
End Sub
跑馬燈.rar (11.58 KB)
|
|