Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro/Function for Keyboard button combinations
I have a DDE link that pulls in certain information to my spreadsheet.
Occassionally the link goes down, but unless the user is really paying attention they may not know the data is stale. When the user depresses Ctrl+Shift+R, it refreshes the link (whether it is current or not), but I am tired of people asking what the combination is (because they forget). I'd like to: a.) create a button that operates the keyboard stroke Ctrl+Shift+R or (better) b.) create a funtion that automatically launches the keyboard stroke at timed intervals. If possible as well, is there a way to set up a notification if the link is down? (like a cell that contains the value "Live" when it is communicating and "Dead" when it isn't) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro/Function for Keyboard button combinations
Hello Matt, You can refresh the data automatically after a certain time has elapsed. The DDE doesn't support a method of determining if it is "Live" or "Dead". Add a new VBA module to your project and copy the macros into it. The Refresh will happen every 15 seconds. You can change this to whatever you need. The format is Hours:Minutes:Seconds. In your code call "RefreshData" to start the automatic refresh. Code: -------------------- Sub RefreshData() Application.OnTime Now() + TimeValue("00:00:15"), "DDERefresh" End Sub Sub DDERefresh Application.SendKeys( "^+R") End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=495560 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use a keyboard button to run a macro | Excel Programming | |||
Keyboard Shortcuts combinations of function keys, c... | Excel Worksheet Functions | |||
writting a macro for the sum function so I can use it as a keyboard shortcut | Excel Programming | |||
writting a macro for the sum function so I can use it as a keyboard shortcut | Excel Programming | |||
writting a macro for the sum function so I can use it as a keyboard shortcut | Excel Programming |