Advertisement

07.29.2008 at 04:11PM PDT, ID: 23605840
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

How to refresh DDE links?

Asked by elmura in Microsoft Excel Spreadsheet Software, Microsoft Office Suite, Visual Basic Programming

Tags: , , , ,

A program I use to connect to feed data to Excel works via a DDE link. There are several DDE links within my spreadsheet that I need to update every second. The command lines of the dde link are arrays that define the parameters of the call to the external program.
What is the best way to refresh the data every second?
Currently, I have a method working that I'm not overly satisfied with. I run an OnTime macro to change one part of the array each second. This causes the link to update correctly but causes a the data on screen to disappear for a split second whilst the link is being changed and Excel has to make all the calculations that relate to this source data. Below is my working code.
When the data disappears, all my calcs go into error until the data reappears. I also have an XML feed into the same spreadsheet every 2 seconds. When both feeds are updated at the same time (every 2 seconds), the data errors for nearly one second!!! As you can see, I have added DoEvents & ScreenUpdating to try & improve this issue. Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
Sub Update1()
    If runThem Then
    Application.ScreenUpdating = False
    Worksheets("Place Data").Range("A49:AJ242").Replace What:=",29", Replacement:=",30", LookAt:=xlPart, SearchOrder:=xlByRows
    DoEvents
    Set oddsFile = CreateObject("Scripting.FileSystemObject")
    oddsFile.CopyFile "C:\Program Files\Aus\Aus4\dds.txt", "C:\Program Files\Aus\Aus4\dds2.txt"    
    Worksheets("Place Data").Range("EB2").QueryTable.refresh BackgroundQuery:=False
    DoEvents
    Application.OnTime Now() + TimeSerial(0, 0, 1), "Update2"
    Application.ScreenUpdating = True
    End If
End Sub
Sub Update2()
    If runThem Then
    Application.ScreenUpdating = False
    Worksheets("Place Data").Range("A49:AJ242").Replace What:=",30", Replacement:=",29", LookAt:=xlPart, SearchOrder:=xlByRows
    DoEvents
    Set oddsFile = CreateObject("Scripting.FileSystemObject")
    oddsFile.CopyFile "C:\Program Files\Aus\Aus4\dds.txt", "C:\Program Files\Aus\Aus4\dds2.txt"
    Worksheets("Place Data").Range("EB2").QueryTable.refresh BackgroundQuery:=False
    DoEvents
    Application.OnTime Now() + TimeSerial(0, 0, 1), "Update1"
    Application.ScreenUpdating = True
End If
End Sub
[+][-]07.30.2008 at 10:25AM PDT, ID: 22122640

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 12:11PM PDT, ID: 22164035

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Microsoft Office Suite, Visual Basic Programming
Tags: Microsoft, Excel, 2002, VBA, VBA
Sign Up Now!
Solution Provided By: mwolfe02
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.20.2008 at 01:06AM PDT, ID: 22528771

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.25.2008 at 08:28PM PDT, ID: 22576398

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628