CW 2.0 and DDE-Excel 
Author Message
 CW 2.0 and DDE-Excel

I have done some work with tables in Excel and still I don't get
to basics of being able to utilize this possibility.

The beginning is OK
ExcelServer = DDEClient('Excel',System')
ExcelServer = DDEClient('Excel',Sheet1')

the I can put values into the sheet using
 DDEPoke(ExcelServer,'R1C1','Input')

Using the macro's in Excel gives the commands that VB uses, but
the syntax of converting this code to CW is not within my reach

If I want to select a range the macro code gives me ie.
    Range("A1:C3").Select

this should be converted to

 DDEExecute(ExcelServer,'[Select("R1C1:R3C3")]')

not straightforward, but if you know how to do it it's easy.

If I the want to select a range and change the font I could get ie.

Sub Makro5()
    Range("A4:C6").Select
    Selection.Font.Bold = True
    Range("A4:B6").Select
    With Selection.Font
        .Name = "Courier"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlNone
        .ColorIndex = xlAutomatic
    End With
    Selection.Font.Bold = True
    Selection.Font.Italic = True
End Sub

If I write after

 DDEExecute(ExcelServer,'[Select("R1C1:R3C3")]')

 DDEExecute(ExcelServer,'[Font("Courier")]')

 it changes the font on the whole sheet, not only on the range.

 I am quite confused with the VB -> CW command comversion syntax.
 Is there a clear way of seeing how to give the commands using
 the VB code as a base ?.

 I must be missing something in my logic. Help very much appreciated

 Thank you

  Bjorn Kaustell



Tue, 05 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel


-->
--> DDEExecute(ExcelServer,'[Select("R1C1:R3C3")]')
-->
--> DDEExecute(ExcelServer,'[Font("Courier")]')
-->
from what I understand, it should be :

  DDEExecute(ExcelServer,'[Font.Selection.Name("Courier")]')

Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet



Tue, 05 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Quote:


> -->
> --> DDEExecute(ExcelServer,'[Select("R1C1:R3C3")]')
> -->
> --> DDEExecute(ExcelServer,'[Font("Courier")]')
> -->
> from what I understand, it should be :

>   DDEExecute(ExcelServer,'[Font.Selection.Name("Courier")]')

> Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet

Thank you for your response:

That would be a very - clear and easy to implement way - of doing it,
but I get a:

   *** DDEExecute - invalid command ***

error message.

I have made an app that counts keyfigures of copmpanies and the end-
users would like to be able to work further from these basevalues.
I on the otherhand would like to give a better look to it, that is
the part moved on to Excel(7) and more readable from the beginning.
It would be nice if it was possilble using CW20.

Thanks again, please help me furhter

Bjorn Kaustell



Wed, 06 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Hi Bjorn,

On Sat, 19 Apr 1997 12:26:00 +0300, Bjorn Kaustell

Quote:

>>   DDEExecute(ExcelServer,'[Font.Selection.Name("Courier")]')

...

Quote:
>That would be a very - clear and easy to implement way - of doing it,
>but I get a:

>   *** DDEExecute - invalid command ***

>error message.

Are you using a translated version of Excel?  Over here they even
translated all the macro names, function names etc., so with a Danish
version of Excel I would have to use Danish names and it wouldn't work
on US versions!  Could be your problem here.

Try to record a macro doing what you want the DDExecute to do and see
how it looks.

Best regards,

Arnor Baldvinsson
Allerup Edb
Tel: +45 4675 7122
Fax: +45 4675 7144
Denmark


http://www.icetips.com

Opinions are mine, and mine alone!



Thu, 07 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel


-->That would be a very - clear and easy to implement way - of doing it,
-->but I get a:
-->
-->   *** DDEExecute - invalid command ***
-->
-->error message.
-->
-->I have made an app that counts keyfigures of copmpanies and the end-
-->users would like to be able to work further from these basevalues.
-->I on the otherhand would like to give a better look to it, that is
-->the part moved on to Excel(7) and more readable from the beginning.
-->It would be nice if it was possilble using CW20.
-->
Bjorn,

as Arnor said, make an Excel macro, then we will help you to translate it to CW syntax. I
had more OLE syntax in mind than DDE syntax. BTW, seems like '[' are unnecessary.
Obviously, the english syntax won't work on a 'localized' Excel. Thanks, Bill !

Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet



Fri, 08 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Quote:

> Bjorn,

> as Arnor said, make an Excel macro, then we will help you to translate it to CW syntax. I
> had more OLE syntax in mind than DDE syntax. BTW, seems like '[' are unnecessary.
> Obviously, the english syntax won't work on a 'localized' Excel. Thanks, Bill !

> Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet

Thank you for your responses. I still don't know where the problem is,
but now I
am ready to try with all possibilities, because this is of big interest
for me.

Here is the code from Excel(7), using the macro, just doing two things,
        - choosing an area ie. c3:e5   and
        - choosing the font 'courier'

With Language/Country settings from Excel set to: English/United States
'
' Makro1 Makro
' E-V on nauhoittanut makron 21.4.1997.
'
'
Sub Makro1()
    Range("C3:E5").Select
    With Selection.Font
        .Name = "Courier"
        .FontStyle = "Normaali"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlNone
        .ColorIndex = xlAutomatic
    End With
End Sub

ExcelServer = DDEClient('Excel','System')
ExcelServer = DDEClient('Excel','Taul1')    In the finnish Excel the
Sheet is Taul

DDEPoke(ExcelServer,'R2C2','Hi')                     Works OK
DDEExecute(ExcelServer,'[Select("R5C2:R7C4")]')      Both finnish and
english works OK (blacks the area)
!DDEExecute(ExcelServer,'[Valitse("R5C2:R7C4")]')    

DDEExecute(ExcelServer,'[Selection.Font.Name("Courier")]')    None of
these work
!DDEExecute(ExcelServer,'[Valinta.Fontti.Nimi("Courier")]')  
                        *** (look below) ***
IF ERROR()
  MESSAGE(ERROR())  returns the error *** DDEExecute - invalid command
***
.

DDEClose(ExcelServer)

With Finnish Country/Languge settings I get

'
' Makro1 Makro
' E-V on nauhoittanut makron 21.4.1997.
'
'
Aliohjelma Makro1()
    Alue("B3:D5").Valitse
    Kanssa Valinta.Fontti
        .Nimi = "Courier"
        .FontinTyyli = "Normaali"
        .Koko = 10
        .Yliviivaus = EP?TOSI
        .Yl?indeksi = EP?TOSI
        .Alaindeksi = EP?TOSI
        .??riviivaFontti = EP?TOSI
        .Varjostettu = EP-TOSI
        .Alleviivaus = xlEiMit??n
        .V?riIndeksi = xlAutomaattinen
    Seis Kanssa
Seis Aliohjelma

No difference, both english and finnish commands work in the same manner
partly.

Thank you again

Bjorn Kaustell



Fri, 08 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Hi Bjorn,

On Mon, 21 Apr 1997 17:25:35 +0300, Bjorn Kaustell

Quote:

>> as Arnor said, make an Excel macro, then we will help you to translate it to CW syntax. I
>> had more OLE syntax in mind than DDE syntax. BTW, seems like '[' are unnecessary.
>> Obviously, the english syntax won't work on a 'localized' Excel. Thanks, Bill !

The [] seems to be necessary for Excel as otherwise it will return
error.

Quote:
>ExcelServer = DDEClient('Excel','System')
>ExcelServer = DDEClient('Excel','Taul1')    In the finnish Excel the

I've tried this back and forth with exactly the same results.  CW will
return error 603 on trying to execute the macro snippet.  I admit this
is my first try at DDE, so I'm certainly no expert, but from what I
had read about DDE this should work.  The macro in Excel can't be much
simpler than this.  We must be doing something wrong here...

Best regards,

Arnor Baldvinsson
Allerup Edb
Tel: +45 4675 7122
Fax: +45 4675 7144
Denmark


http://www.icetips.com

Opinions are mine, and mine alone!



Fri, 08 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel


Bjorn,

-->
-->ExcelServer = DDEClient('Excel','System')
-->ExcelServer = DDEClient('Excel','Taul1')    In the finnish Excel the
-->Sheet is Taul
-->
-->DDEPoke(ExcelServer,'R2C2','Hi')                     Works OK
-->DDEExecute(ExcelServer,'[Select("R5C2:R7C4")]')      Both finnish and
-->english works OK (blacks the area)
-->!DDEExecute(ExcelServer,'[Valitse("R5C2:R7C4")]')    
-->
-->DDEExecute(ExcelServer,'[Selection.Font.Name("Courier")]')    None of
-->these work
-->!DDEExecute(ExcelServer,'[Valinta.Fontti.Nimi("Courier")]')  
-->                  *** (look below) ***
I have not much experience with Excel, but with Word, you have to be careful about the
space between the parent object and the child, like in
['Selection .Font .Name']
                ^       ^
Another point: I found useful to have a DDEcommand variable,  declared as a string and do
something like:
DDECommand = '[Selection .Font .Name("Courier")]'
DDECommand =CLIP(DDECommand)
DDEExecute(ExcelServer,DDECommand)

But I believe your problem is in the missing space before the point, or some stupid syntax
trick like that...VBA is very, very sensitive about syntax, at least with DDE.

Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet



Fri, 08 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Quote:

> I have not much experience with Excel, but with Word, you have to be careful about the
> space between the parent object and the child, like in
> ['Selection .Font .Name']
>                 ^       ^
> Another point: I found useful to have a DDEcommand variable,  declared as a string and do
> something like:
> DDECommand = '[Selection .Font .Name("Courier")]'
> DDECommand =CLIP(DDECommand)
> DDEExecute(ExcelServer,DDECommand)

> But I believe your problem is in the missing space before the point, or some stupid syntax
> trick like that...VBA is very, very sensitive about syntax, at least with DDE.

> Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet

Thanks again !

I tried these too, but the same error (603) occurs. I tried also a
number of combimnations with spaces and carriage returns (<<13>).

Do these DDE-commands work with an american/english excel? CW2.0 /
Ecxel(7) and WIN95.

In the command
 - DDEExecute(ExcelServer,'[WorkBook.Activate("Taul1")]')

which works OK, there is a dot, no spaces needed.

Still wishing for a solution,
 -as being able to use Excel and Word thru DDE gives many good new
features to CW.

Thank you again,

Bjorn Kaustell



Sat, 09 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel


-->
-->Thanks again !
-->
-->I tried these too, but the same error (603) occurs. I tried also a
-->number of combimnations with spaces and carriage returns (<<13>).
-->
-->Do these DDE-commands work with an american/english excel? CW2.0 /
-->Ecxel(7) and WIN95.
-->
-->In the command
--> - DDEExecute(ExcelServer,'[WorkBook.Activate("Taul1")]')
-->
Bjorn, I don't have enough time 'right now' to test something with Excel, bit will do in
the afternoon, and let you what I find. BTW, which CW version are you using ?

Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet



Sun, 10 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

I'm using CW 2.00201

Quote:


> Bjorn, I don't have enough time 'right now' to test something with Excel, bit will do in
> the afternoon, and let you what I find. BTW, which CW version are you using ?

> Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet



Sun, 10 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Quote:

> Using the macro's in Excel gives the commands that VB uses, but
> the syntax of converting this code to CW is not within my reach
>  I am quite confused with the VB -> CW command comversion syntax.
>  Is there a clear way of seeing how to give the commands using
>  the VB code as a base ?.

Hi Bjorn,

I am also a bit of a novice in the DDE world. But it does work. I picked

up the following tips from comp.lang.clarion.

What works for me when doing DDE "CW to Excel" is to use the Excel 4.0

macros. I also had many problems using the VB macro, plus they are very
long.

[VB macros are ok in WORD]

So if you dont mind using 4.0 and not VB, then when recording a macro in
Excel, go options,
then click on the 4.0.

The 4.0 macro is very easy to convert to CW.

For Example, here is a 4.0 macro. I selected a few cells and then
centred them.

Macro1
=SELECT("R7C3:R7C7")
=ALIGNMENT(3,FALSE,3,0,FALSE)
=RETURN()

You only need the two middle lines, forget the Maro1 name and the =
RETURN()

In CW this would be

  LOC:CellAddr='R7C3:R7C7'
  !Select the Cells
  DDEexecute(LOC:ExcelServer,'[SELECT("' & Clip(LOC:CellAddr) & '")]')

  Do CheckDDeError
  !Now Centre them

  DDEexecute(LOC:ExcelServer,'[ALIGNMENT(3,FALSE,3,0)]') !3,False =
Centre

  Do CheckDDeError !Error routine I got from one of the CW books, see my
routines below

Note : DDEexecute above and DDEpoke below

To send a CW string variable I would do the following :-

  LOC:Row = 10 !Which row in Excel

  LOC:Col = 2  !Which column in Excel

  LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

  DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(TAQ::LineNo)) ! Use Clip
when it is a string

  Do CheckDDeError

To send a CW Numeric variable :

  LOC:Col += 1 !Increment the Column

  LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

  DDEPoke(LOC:ExcelServer,LOC:CellAddr,TAQ::ASW_MM)

  Do CheckDDeError

I have dumped a section of raw code from one of my apps, the comments
are not very good,

if you think it will help, let me know which part you might want to tear
apart.

There are routines that I have built up to handle some of the commands.

hope it helps

regards


"An Error doesn't become a mistake, until you refuse to correct it"

[Code from my app]

   ! *** Finished setting up the memory Queue ***

   ! *** Start of DDE to Excel - No header ***

    System{PROP:DDETimeout} = 6000 !Time out after 10 secs, 100 = 1 sec,
12000 = 2 mins

    !Control event handling,after generated code,?ExcelButton,Accepted

    GLO:StatusMSG = 'Connecting to DDE Server EXCEL . . . '

    Display(GLO:StatusMSG)

    LOC:Excel = 99

    LOC:ExcelServer = DDECLIENT('Excel','XMTotal.xls') ! Now connect DDE
Server

    IF NOT LOC:ExcelServer

       LOC:Excel = 0

       BEEP(BEEP:SystemExclamation)

       GLO:StatusMSG = 'Starting Excel ... Please wait . . . '

       Display(GLO:StatusMSG)

       LOC:ExcelPath=GetINI('DDE2Excel','ExcelPath',,'XMaint.ini')

       LOC:CustTotals=GetINI('DDE2Excel','CustTotals',,'XMaint.ini')

       LOC:Formulae = Clip(LOC:ExcelPath) & ' ' & Clip(LOC:CustTotals)

       RUN(LOC:Formulae)

       IF RunCode()

          Stop('Error in Starting Excel.exe : ' & Error())

          Return

       END

    ELSE

      LOC:Excel = 1

    END

  IF NOT LOC:Excel !Excel had to be started, Now connect DDE Server
again

     LOC:ExcelServer = DDECLIENT('Excel','XMTotal.xls')

     IF NOT LOC:ExcelServer

        BEEP(BEEP:SystemExclamation)

        Stop('Error in Starting Excel, Start manually ... Hit ENTER to
Continue')

        Return

     END

  END

  LOC:Cust_ID = GLO:Cust_ID

  LOC:Site_ID = ''

  LOC:Row = 10

  LOC:Col = 3

  LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

  !Read the Article Codes from the Filters file

   FIL:ID = 1

   GET(Filter,FIL:ID)

   IF ErrorCode() then Clear(FIL:Record).

  !Read the memory Queue & Send info to Excel

  !Loop through the Queue

   LOC:CountRecord = Records(Table:Queue)

   Loop LOC:I = 1 to LOC:CountRecord

     GET(Table:Queue,LOC:I)

     If ErrorCode() then Stop(Error()).

     GLO:StatusMSG = 'Exporting Revenue for : ' & Clip(TAQ::Name)

     Display(GLO:StatusMSG)

      LOC:Row += 1

      LOC:Col = 2

      !Start the Schedule Data

       LOC:Col = 2

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(TAQ::LineNo))

       Do CheckDDeError

       LOC:Col += 1

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(TAQ::Cust_ID))

       Do CheckDDeError

       LOC:Col += 1

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(TAQ::Name))

       Do CheckDDeError

       !HW - Article & Value

       LOC:Col += 2

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(FIL:Art_HW))

       Do CheckDDeError

       LOC:Col += 1

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,TAQ::HW_MM)

       Do CheckDDeError

       !OS - Article & Value

       LOC:Col += 2

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(FIL:Art_OS))

       Do CheckDDeError

       LOC:Col += 1

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,TAQ::OS_MM)

       Do CheckDDeError

       !ASW - Article & Value

       LOC:Col += 2

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(FIL:Art_ASW))

       Do CheckDDeError

       LOC:Col += 1

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,TAQ::ASW_MM)

       Do CheckDDeError

       LOC:Col += 2

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,TAQ::Total_MM)

       Do CheckDDeError

       !Send a formula

       LOC:Col += 1

       LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

       LOC:Formulae ='=IF((G' & LOC:Row &'+J'& LOC:Row & '+M' & LOC:Row
& ')=O' & LOC:Row & ',"OK","??")'

       DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

       Do CheckDDeError

   END ! Loop LOC:I = 1 to LOC:CountRecord

  GLO:StatusMSG = 'Creating & Sending Total-Formulaes'

  Display(GLO:StatusMSG)

  BEEP(BEEP:SystemExclamation)

  !Do Total Formulaes Now

  LOC:Row += 2

        !Format the Total Line

        LOC:CellAddr = 'R' & LOC:Row & 'C2:' & 'R' & LOC:Row & 'C15'

        Do SelectRange

        Do Font14

        Do Align3

        DDEexecute(LOC:ExcelServer,'[BORDER(0,0,0,2,2,,,,,3,3)]')

        Do CheckDDeError

        LOC:CellAddr = 'R' & LOC:Row

        Do Height17

  LOC:Col = 4

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        LOC:Formulae ='Total Monthly Maintenance :'

        DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

        Do CheckDDeError

  LOC:Col = 7

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        LOC:Formulae ='=Sum(G11:G' & LOC:Row-2 & ')'

        DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

        Do CheckDDeError

  LOC:Col = 10

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        LOC:Formulae ='=Sum(J11:J' & LOC:Row-2 & ')'

        DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

        Do CheckDDeError

  LOC:Col = 13

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        LOC:Formulae ='=Sum(M11:M' & LOC:Row-2 & ')'

        DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

        Do CheckDDeError

  LOC:Col = 15

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        LOC:Formulae ='=Sum(O11:O' & LOC:Row-2 & ')'

        DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

        Do CheckDDeError

        !Note for The End

  LOC:Col  = 2

        LOC:Row += 2

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        Do SelectRange

        DDEexecute(LOC:ExcelServer,'[FORMAT.FONT(,,TRUE,TRUE)]')

        Do CheckDDeError

        LOC:CellAddr = 'R' & LOC:Row & 'C' & LOC:Col

        LOC:Formulae ='The End'

        DDEPoke(LOC:ExcelServer,LOC:CellAddr,Clip(LOC:Formulae))

        Do CheckDDeError

        !Justify across

        LOC:CellAddr = 'R' & LOC:Row & 'C2:R' & LOC:Row & 'C15'

        Do SelectRange

        DDEexecute(LOC:ExcelServer,'[ALIGNMENT(7,FALSE,3,0,FALSE)]')
!7,False = Justify

        Do CheckDDeError

        !Set the Print Range

        LOC:CellAddr = 'R11C2:R' & LOC:Row & 'C15'

        Do SelectRange

        DDEexecute(LOC:ExcelServer,'[SET.PRINT.AREA()]')

        Do CheckDDeError

        !Position to the "All-is-Ok"

        LOC:CellAddr = 'R' & LOC:Row+4 & 'C' & LOC:Col

        Do SelectRange

  DDEClose(LOC:ExcelServer)

  FREE(Table:Queue)

  Beep(BEEP:SystemQuestion)

  Beep(BEEP:SystemQuestion)

  GLO:StatusMSG = 'Finished : Revenue Split by Customer Totals '

  Display(GLO:StatusMSG)

!Procedure Routines

CheckDDeError Routine

    DDeErrorMsg = ''

    LOC:ErrorNo = ErrorCode()

    !Check for DDE Error

    IF LOC:ErrorNo > 600 !Errorcode for DDE Failed

       IF LOC:ErrorNo = 603 !!DDeExecute Failed

          DDERead(LOC:ExcelServer,DDE:Manual,'GetErrorNum',DDEErrorNum)

          DDERead(LOC:ExcelServer,DDE:Manual,'GetErrorMsg',DDEErrorMsg)

          Message('Error 603 : ' & DDeErrorNum & ' : ' &

Clip(DDeErrorMsg))

       Elsif LOC:ErrorNo = 605 !Timeout Error

          Message('Error 605 : DDE Timeout with WinWord')

       Else

          Message('Error > 600 : ' & LOC:ErrorNo)

       END

    END

Align2  Routine

   DDEexecute(LOC:ExcelServer,'[ALIGNMENT(2,FALSE,3,0)]') !2,False =
Left

   Do CheckDDeError

Align3  Routine

   DDEexecute(LOC:ExcelServer,'[ALIGNMENT(3,FALSE,3,0)]') !3,False =
Centre

   Do CheckDDeError

Align4  Routine
...

read more »



Thu, 14 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Hi Corrie,

On Sun, 27 Apr 1997 08:42:47 -0700, Corrie de Bruin

Quote:


>> Using the macro's in Excel gives the commands that VB uses, but
...
>I am also a bit of a novice in the DDE world. But it does work. I picked
...
>What works for me when doing DDE "CW to Excel" is to use the Excel 4.0
>macros. I also had many problems using the VB macro, plus they are very
>long.

So it works for the 4.0 macros, but not the VB macros?  Hmm, I've had
similar problems running VB macros in Excel 5.0, so maybe it just
don't understand it's own language<g>

Best regards,

Arnor Baldvinsson
Allerup Edb
Tel: +45 4675 7122
Fax: +45 4675 7144
Denmark


http://www.icetips.com

Opinions are mine, and mine alone!



Thu, 14 Oct 1999 03:00:00 GMT  
 CW 2.0 and DDE-Excel

Quote:

> Hi Bjorn,

> I am also a bit of a novice in the DDE world. But it does work. I picked

> up the following tips from comp.lang.clarion.

> What works for me when doing DDE "CW to Excel" is to use the Excel 4.0

> macros. I also had many problems using the VB macro, plus they are very
> long.

> [VB macros are ok in WORD]

> So if you dont mind using 4.0 and not VB, then when recording a macro in
> Excel, go options,
> then click on the 4.0.

> The 4.0 macro is very easy to convert to CW.

Very, very much appreciated. Thank YOU !!!

This open many new possibilities to make use of CW and I believe
also for others.

( Would be nice if the VB-commands would work, I guess they should.
There must be some small thing that prevents it from working
correctly. )

Well, not a big problem as it works with the Excel4 - macro's.

Thank you again !

Bjorn Kaustell



Fri, 15 Oct 1999 03:00:00 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Using DDE:s CW / Excel

2. VisualWorks 2.0, DDE and Excel

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

4. If you have problems installing CW 2.0 with a CW 1.5 diskette

5. CW 1.5 to CW 2.0 Conversion?

6. CW 2.0 vs. CW 1.5

7. CW 1.5/2.0 and ODBC to MS/Access 2.0

8. Problems with DDE link between APL Win and Excel

9. Returning data from Excel with DDE

10. An old one: DDE and Excel

11. DDE to EXCEL

12. Once more DDE and Excel

 

 
Powered by phpBB® Forum Software