Office 板


LINE

嗯..這VBA的我也不太會 http://www.taltech.com/TALtech_web/support/dde_sw/ddeexcel508.htm 找了一下 有些是直接寫到儲存格 不過這樣要怎麼觸發就不知道了 To use it enter the string: [RUN("GetSWDataBelow")] as the Field Postamble DDE Command after the last data field that you have defined. 不很明瞭... 網址是其中一例 往上一層還有其他 http://www.angelfire.com/biz/rhaminisys/ddeapps.html#DDEExcelSpec 這個也講了一些 但好像比較沒有用(?) ※ 引述《psion (psion)》之銘言: : 標題: [請益] dde怎樣儲存資料? : 時間: Wed Apr 23 01:06:34 2008 : : ※ [本文轉錄自 Stock 看板] : : 作者: psion (psion) 看板: Stock : 標題: [請益] dde怎樣儲存資料? : 時間: Tue Apr 22 23:05:22 2008 : : 我剛學excel : 需要用dde擷取每分鐘大盤成交資訊(成交量買賣均張之類) : 結果進來的資料無法儲存 : 比方說A1格是dde輸入的成交量 : 我想把每分鐘更新的資料依序儲存在A2以後的格子 : 可是發現worksheet_change無法被dde觸發(這是我上網找到的原因) : 請問還有其他方法可以儲存dde資料嗎? : 謝謝 : : -- :



※ 發信站: 批踢踢實業坊(ptt.cc)
: ◆ From: 203.70.6.55 : → powerair:自行寫個VBA程式? :P 04/22 23:28 : → psion:就是不知道怎麼寫啊 XD 想找範例都不知從何找起 04/22 23:39 : → psion:worksheet_change也是別人教我的vba語法 04/22 23:39 : : 我剛剛找上網到一種可能的寫法(利用dde觸發calculate) : 想請高手指點一下 : : Private Sub Worksheet_Calculate() : : Application.EnableEvents = False(請問這行跟下面True那行是必要的嗎?) : : Range("A65536").End(xlUp).Offset(1, 0) = Range("A1").Value : : Range("B65536").End(xlUp).Offset(1, 0) = Range("B1").Value : : Range("C65536").End(xlUp).Offset(1, 0) = Range("C1").Value : : Application.EnableEvents = True : : End Sub : : A1 B1 C1就是dde資料進來的格子 : 不知道這樣離正確的寫法還有多遠? : 謝謝 網址中的備份一下 Sub GetSWDataBelow() Dim X As Long ' Dim all variables Dim MyVar As Variant Dim MyString As String On Error Resume Next ' ignore errors Application.DisplayAlerts = False ' turn off DDE warning messages X = DDEInitiate("WinWedge", "COM1") ' connect to WinWedge MyVar = DDERequest(X, "Field(1)") ' get Field(1) DDETerminate X ' terminate the DDE link MyString = MyVar(1) ' convert to a string ' find the row number of the last empty cell at the bottom of Column 1 X = Sheets("Sheet1").Cells(65000, 1).End(xlUp).Row + 1 Cells(X, 1).Value = MyString ' put value in the last row End Sub : : -------------------------------------- : ※ 編輯: psion 來自: 203.70.6.55 (04/23 00:11) : ※ 編輯: psion 來自: 203.70.6.55 (04/23 00:13) : → powerair:讀DDE提供的時間 變動時(分+1) 複製到你要的欄位 04/23 00:10 : → psion:ㄟ 問題就在於要怎樣複製 ontime是不必要的 因為本來就是每 04/23 00:14 : → psion:分鐘更新一次 所以光是dde值變動 還要搭配能觸發的事件 04/23 00:16 : → psion:change不能觸發 calculate可以 這是我目前上網找到的心得 04/23 00:16 : → psion:不過很感激您的回應 能請您寫出來讓我學習嗎 謝謝 04/23 00:17 : → powerair:Trading版應該蠻多高手的 我只有觀念 不會寫 抱歉 :) 04/23 00:21 : → psion:呵呵 Trading版人氣很低迷啊 04/23 00:25 : 推 neant:轉去office板 看看 excel高手很多 04/23 00:38 : : -- :



※ 發信站: 批踢踢實業坊(ptt.cc)
: ◆ From: 203.70.6.55 --



※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.164.49.110 ※ 編輯: JieJuen 來自: 218.164.49.110 (04/23 15:17)







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:e-shopping站內搜尋

TOP