Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using Excel's DDE function--urgent!

Posted on 1998-03-03
6
Medium Priority
?
400 Views
Last Modified: 2008-02-01
I need to use the DDE functions of excel in VB5.
(i.e. DDEIntiat).
The serve is not excel, but is setup like excel.
I am writing a VB5 program to do DDE with it.
0
Comment
Question by:JHBrother
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:anthonyc
ID: 1458382
Why DDE?
0
 

Author Comment

by:JHBrother
ID: 1458383
I have a piece of instrument (about 4 years old), the manufacture provide a DDE server so I can issue command and get data through DDE.
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1458384
oh I thought you meant DDE with Excel.....  Excel supports OLE automation which is much better.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:JHBrother
ID: 1458385
The manufacture provided an example, but it was with excel as follows:

ReadChan = DDEInitiate("SRead", "AllData")
DDEExcute ReadChan,"[Openit](9600,2)"
...

I tried to use VB5 to do it, didn't work. It returns 282 (no response". My DDE program can communicate with a different server.



0
 

Accepted Solution

by:
thomaskramer earned 100 total points
ID: 1458386
Don´t know, if i understood you correctly:

This example establishes a DDE link with Microsoft Excel, places some values into cells in the first row of a new worksheet, and charts the values. LinkExecute sends Microsoft Excel the command to activate a worksheet, select some values, and chart them. To try this example, Microsoft Excel must be installed on your computer and in the path statement of your Autoexec.bat file. Paste the code into the Declarations section of a form that has a TextBox control with the default name Text1, and then press F5 and click the form.

Private Sub Form_Click ()
      Dim Cmd, I, Q, Row, Z      ' Declare variables.
      Q = Chr(34)      ' Define quotation marks.
      ' Create a string containing Microsoft Excel macro commands.
      Cmd = "[ACTIVATE(" & Q &"SHEET1" & Q & ")]"
      Cmd = Cmd & "[SELECT(" & Q & "R1C1:R5C2" & Q & ")]"
      Cmd = Cmd & "[NEW(2,1)][ARRANGE.ALL()]"
      If Text1.LinkMode = vbNone Then
            Z = Shell("Excel", 4)      ' Start Microsoft Excel.
            Text1.LinkTopic = "Excel|Sheet1"      ' Set link topic.
            Text1.LinkItem = "R1C1"      ' Set link item.

Text1.LinkMode = vbLinkManual      ' Set link mode.
      End If
      For I = 1 To 5
            Row = I      ' Define row number.
            Text1.LinkItem = "R" & Row & "C1"      ' Set link item.
            Text1.Text = Chr(64 + I)      ' Put value in Text.
            Text1.LinkPoke      ' Poke value to cell.
            Text1.LinkItem = "R" & Row & "C2"      ' Set link item.
            Text1.Text = Row      ' Put value in Text.
            Text1.LinkPoke      ' Poke value to cell.
      Next I
      On Error Resume Next
      Text1.LinkExecute Cmd      ' Carry out Microsoft Excel commands.

MsgBox "LinkExecute DDE demo with Microsoft Excel finished.", 64
   End
End Sub
0
 

Author Comment

by:JHBrother
ID: 1458387
I am not try to DDE with Excel.
I want to DDE with another App and the vender provided an example  with Excel. it uses function like DDEIntiate. So I would like to use those functions.
Maybe I can try to get an OLE with Excel and then less Excel DDE with it?
I will try a few more things
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question