LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown topics in Excel DDE

Hello.
I am trying to get values from Excel into DIAdem 8. To find out, which Excel sheets are currently available, the topic "System" knows and delivers their names as a list when queried with "topics" as item to a DDERequest, such as in the folowing word macro
------------Word Macro---------------------
Sub test2()
'
' test2 Makro
' Makro erstellt am 22.06.2006 von MConze
'[Vlies_DoE_060404.xls]R01
Dim cmd As String
Dim chan As Long

chan = DDEInitiate(App:="Excel", Topic:="System")
topicList = DDERequest(Channel:=chan, Item:="Selection")
Selection.InsertAfter topicList
DDETerminateAll

End Sub
------------Word Macro---------------------
 
which delivers an output such as
 
[book1.xls]Tabelle1            [book1.xls]Tabelle2            [book1.xls]Tabelle3            System
 
 
However, DIAdem returns a different result upon the same DDERequest:
 
 
-----------DIAdem VBS ----------------
On Error Resume Next
Set Excel = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Set Excel = CreateObject("Excel.Application")
End if
err.clear
call DDEClose()
call DDEOpen("Excel","System")
call DDErequesttext("Topics",1000)
msgbox DDEreqvalue
'call DDErequesttext("Protocols",1000)
'msgbox DDEreqvalue
'call DDErequesttext("Selection",1000)
'msgbox DDEreqvalue
'call DDErequesttext("Status",1000)
'msgbox DDEreqvalue
'call DDErequesttext("Sysitems",1000)
'msgbox DDEreqvalue
'call DDErequesttext("Formats",1000)
'msgbox DDEreqvalue
call DDEclose()
-----------DIAdem VBS ----------------
 
will only give
System
as output.
It is not a matter of more than 1 word, as can be seen when other topics to "System" are called.
 
Neither is it possible to call a value by
Application Excel 
 
0 Kudos
Message 1 of 2
(3,547 Views)
Hello,
is there a reason why you are trying to use the DDE commands for the communication?
I dont know why the Interface returns different values if called from Word or DIAdem, problems like that often are related to different versions of Excel.
Did you try to access Excel via the ActiveX API?

Here are some examples how to use the interface from DIAdem.

regards

Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 2
(3,536 Views)