Davide Dozza wrote:

Hi all,

We've a SAS application which populates an Excel document using DDE.
We need to translate such procedure in order to populate a Calc document in the same way.

The question is: how much is DDE standard enough in order to reuse the code?

Davide

The DDE is probably NOT standard. Here is code that I used:

Sub ExampleDDE
 Dim nDDEChannel As Integer
 Dim s As String
 REM OOo must have the file open or the channel will not be opened
 nDDEChannel = DDEInitiate("soffice", "c:\TST.sxc")
 If nDDEChannel = 0 Then
   Print "Sorry, failed to open a DDE channel"
 Else
   Print "Using channel " & nDDEChannel & " to request cell A1"
   s = DDERequest(nDDEChannel, "A1")
   Print "Returned " & s
   DDETerminate(nDDEChannel)
 End If
End Sub


Officially, I think that DDE is no longer supported, but last I heard, this code works in the latest Beta. In 1.1.x, this will cause OOo to crash.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to