Using DDE:s CW / Excel 
Author Message
 Using DDE:s CW / Excel

I am trying to read from Excel using DDE:s.

DDERead works fine when picking up values from a sheet.
DDEREAD(ExcelServer,DDE:Manual,'R1C1',DDEReadVal)

Does someone know how to read a value from another tab.
I have tried with
DDEREAD(ExcelServer,DDE:Manual,'Tab2!R1C1',DDEReadVal)
                                ===========
( inside a loop ),  but it doesn't work.

Question 2:
How do I read to/from Winword spredsheets using DDE:s. How does
ie. the DDEREAD look like.

Is there any good DDE-examples anywhere more than those from
Topspeed (I don't mean that they aren't)

Thank you for any help on this topic

Bjorn Kaustell, Finland



Sat, 10 Apr 1999 03:00:00 GMT  
 Using DDE:s CW / Excel

Quote:

> I am trying to read from Excel using DDE:s.

> DDERead works fine when picking up values from a sheet.
> DDEREAD(ExcelServer,DDE:Manual,'R1C1',DDEReadVal)

> Does someone know how to read a value from another tab.
> I have tried with
> DDEREAD(ExcelServer,DDE:Manual,'Tab2!R1C1',DDEReadVal)
>                                 ===========
> ( inside a loop ),  but it doesn't work.

> Question 2:
> How do I read to/from Winword spredsheets using DDE:s. How does
> ie. the DDEREAD look like.

> Is there any good DDE-examples anywhere more than those from
> Topspeed (I don't mean that they aren't)

> Thank you for any help on this topic

> Bjorn Kaustell, Finland

Dear Bjorn,

I've done some DDE-interfacing with Excel. In order to be of
any assistence, tell me if your using CW1.5  OR CW2.

Kind regards,

Arno Rog




Sun, 11 Apr 1999 03:00:00 GMT  
 Using DDE:s CW / Excel

Quote:


> > I am trying to read from Excel using DDE:s.

> Dear Bjorn,

> I've done some DDE-interfacing with Excel. In order to be of
> any assistence, tell me if your using CW1.5  OR CW2.

> Kind regards,

> Arno Rog

Hello, Arno,
  Thank you for answering,
  I am using CW 2.0 (2.001) and I am very interested in the principals
of how the "adresses" in the ie. DDEREAD

 DDEREAD(ExcelServer,DDE:Manual,'R1C1',DDEReadVal)

                        where   'R1C1'  = "adress"

  ( I am also trying to read from another application, that reads
   stockvalues from another application. It has it's own dde-
   command to put into the spreadsheet cell and is:
      =ProgName|'StockName'!'Bid', which reminds of the
   commands Excel uses when reading from anothe sheet
       [AnotherSheet.xls]AnotherSheet!a1 )

  Now I have tried to find out what are the proncipals both for
  reading from Excel and other programs and also from ie. WinWord
  and its sheets.

  I am interested anything on this subject.

  I have also tried to find out how to close another app using
  dde:s, with many combinations of " ' [ { ( . " and other separators
  but nothing seems to work.

  The examples in the manual don't ( as I understand ) help
  to give an over all explanation how different values in
  other applications ar to be "addressed"

  Thank you

  Bjorn Kaustell



Sun, 11 Apr 1999 03:00:00 GMT  
 Using DDE:s CW / Excel

Bjorn, all you have to remember is that the DDE commands are exactly the
same as Excel 4's macro commands. So if you ever have a question on how to
do something, RECORD A MACRO (but press OPTIONS, because it defaults to
creating a VB macro), and wail away... You'll be amazed...

-Rich



Quote:
> I am trying to read from Excel using DDE:s.

> DDERead works fine when picking up values from a sheet.
> DDEREAD(ExcelServer,DDE:Manual,'R1C1',DDEReadVal)

> Does someone know how to read a value from another tab.
> I have tried with
> DDEREAD(ExcelServer,DDE:Manual,'Tab2!R1C1',DDEReadVal)
>                            ===========
> ( inside a loop ),  but it doesn't work.



Tue, 13 Apr 1999 03:00:00 GMT  
 Using DDE:s CW / Excel

Quote:
>Hello, Arno,
>  Thank you for answering,
>  I am using CW 2.0 (2.001) and I am very interested in the principals
>of how the "adresses" in the ie. DDEREAD

> DDEREAD(ExcelServer,DDE:Manual,'R1C1',DDEReadVal)

>                    where   'R1C1'  = "adress"

>  ( I am also trying to read from another application, that reads
>   stockvalues from another application. It has it's own dde-
>   command to put into the spreadsheet cell and is:
>      =ProgName|'StockName'!'Bid', which reminds of the
>   commands Excel uses when reading from anothe sheet
>       [AnotherSheet.xls]AnotherSheet!a1 )

>  Now I have tried to find out what are the proncipals both for
>  reading from Excel and other programs and also from ie. WinWord
>  and its sheets.

>  I am interested anything on this subject.

>  I have also tried to find out how to close another app using
>  dde:s, with many combinations of " ' [ { ( . " and other separators
>  but nothing seems to work.

>  The examples in the manual don't ( as I understand ) help
>  to give an over all explanation how different values in
>  other applications ar to be "addressed"

Bjorn:

If you can find it at a bookstore, I highly recommend the book
"Windows Programming For Mere Mortals" by Woody Lenhard.  It's the
best How-To book on DDE I've ever seen.  It's all written from a VB
perspective but that all translates to CW pretty easily.

A few hints that may help you are:

1. For quite a few things in Excel or Word, you need to actually send
a basic program using the DDDExecute command and have it do something
for you and return the result.  Not everything on a sheet is available
to the DDEPoke command.  Now I don't know in Excel what is and what
isn't available to DDEPeek but I'll guaranteed that something isn't
available there and you will need to use DDEExecute to get it, and
Murphys law indicates that the information you are most likley to need
will fall in this category.

2. Frequently if you are trying to do something sophisticated you will
need to send a command to your application and have it do the
calculation and return the result to you via DDE.  This is done by
making your CW app into a DDE server and sending a program to the
client app that instructs it to do something and return the result to
you by using a DDEPoke (to you).

3.  Shutting down a program using DDE is problematic. That's because
DDE is an asynchronous protocol that must have every message verified
on both ends.  So if you send a shutdown command to an application and
it immediatley shuts down then it will never be able to complete it's
end of the DDE conversation because the DDE server (e.g. Excel) in
this case has shut down before the DDE command completes.  To get
around this you can use 2 methods  a) send a command with DDEExecute
that essentially says to wait some short period of time and then exit
or b) don't use DDE to shut the app down.  Find the handle of the
app's main window and post the necessary windows messages using
SendMessage to tell it to shut down.  Method A is easy and works well
with MS apps like Excel and Word but may not work with other apps.

Hope this helps.  Don't feel stupid if you're having trouble with DDE.
Everyone including Microsoft has trouble with it and the Lenhard books
is the only single piece of good documentation I've ever seen on the
subject.

Wade Hatler



Thu, 15 Apr 1999 02:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. CW 2.0 and DDE-Excel

2. Using Excel with DDE

3. Reading/Writing from/to Excel/Word using DDE (PLEASE HELP)

4. How uses DDE in C5 PE with Microsoft Office 97 Excel

5. Q: How to fill an excel sheet with data from tcl using DDE

6. DDE using CW

7. Using CW via DDE

8. DDE DDE DDE DDE DDE ( once more, help needed )

9. Using CW as a DDE Server

10. how to create an excel workbook using the excel toolkit

11. Using Win32OLE with Excel leaves Excel process hanging

12. Problems with DDE link between APL Win and Excel

 

 
Powered by phpBB® Forum Software