Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
Worksheet gets update from DDE server
I am dealing with an application that gets an update from a 3rd party DDE
server. This occurs when the workbook is opened (uses workbook_open()). The VB code in workbook_open issues a call to the DDE server. It takes a few seconds (varies) for the results to come back. Colums B and C are updated with approximately 1000 rows of data. The worksheet has a chart. Besides issuing the call to the DDE server, the VB code in workbook_open() is used to tweak the chart. However, the VB code must wait until the results come back from the DDE server. That is where I am having trouble. If I use MsgBox to pause execution, the DDE results come back, I click OK, and everything works fine. If I instead use "Application.Wait" to pause for several seconds, it appears that the DDE updates are blocked, and so the B and C cell values are not populated with the data that are required by the VB chart code. If I create a "do loop", testing for the presence of the DDE data, nothing happens, so it looks like that blocks the DDE updates too. Does anyone know of a way of pausing a VB script, that will not block DDE updates to a worksheet? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet gets update from DDE server
Hi,
Here is a sample. Dim WithEvents wd As Word.Application Dim condition As Boolean Private Sub Command1_Click() condition = False Dim exapp As Excel.Application Set exapp = New Excel.Application Set wd = New Word.Application wd.Documents.Open "c:\test.doc" wd.Visible = True channelNumber = exapp.DDEInitiate( _ App:="WinWord", _ topic:="C:\test.doc") exapp.DDEExecute channelNumber, "[FILEPRINT]" Do DoEvents Debug.Print "Wait for DDE Call return" Loop Until condition = True exapp.DDETerminate channelNumber End Sub Private Sub wd_DocumentBeforePrint(ByVal Doc As Word.Document, Cancel As Boolean) condition = True End Sub Regards, Peter Huang Microsoft Online Partner Support Get Secure! www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights. -------------------- X-Tomcat-ID: 204477300 References: t MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: (Peter Huang [MSFT]) Organization: Microsoft Date: Thu, 21 Aug 2003 07:50:22 GMT Subject: Worksheet gets update from DDE server X-Tomcat-NG: microsoft.public.excel.programming Message-ID: Newsgroups: microsoft.public.excel.programming Lines: 71 Path: cpmsftngxa06.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.excel.programming:408717 NNTP-Posting-Host: TOMCATIMPORT2 10.201.218.182 Hi, You may try to DoEvents in the "do loop". Regards, Peter Huang Microsoft Online Partner Support Get Secure! www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights. -------------------- From: "hmmm..." Newsgroups: microsoft.public.excel.misc,microsoft.public.excel .programming Subject: Worksheet gets update from DDE server Lines: 22 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: t Date: Wed, 20 Aug 2003 16:51:10 GMT NNTP-Posting-Host: 209.178.190.87 X-Complaints-To: X-Trace: newsread4.news.pas.earthlink.net 1061398270 209.178.190.87 (Wed, 20 Aug 2003 09:51:10 PDT) NNTP-Posting-Date: Wed, 20 Aug 2003 09:51:10 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli n e.de!nntp-relay.ihug.net!ihug.co.nz!logbridge.uoregon.edu!ne wshub.sdsu.edu! e lnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthl ink.net!newsread4 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 - Sharpoint 2003 can't update list on server | Excel Discussion (Misc queries) | |||
Creating Worksheet Using Server Object | Excel Worksheet Functions | |||
Automatically update links when server names change | Excel Worksheet Functions | |||
SQL Server UPDATE Database from Excel Table | Links and Linking in Excel | |||
Creating Worksheet using Server Object | Excel Worksheet Functions |