Board logo

標題: [轉貼] Excel 跑馬燈 [打印本頁]

作者: zheng211016    時間: 2018-4-4 17:58     標題: Excel 跑馬燈

之前在某個網站上看到有人分享的 所以也不吝嗇給大家
程式碼如下:
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

[attach]28499[/attach]




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)