DDEPoke send only first number

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
milivoj84
Posts: 2
Joined: Sat Dec 22, 2018 2:50 am

DDEPoke send only first number

Post by milivoj84 »

Hello,
I'm trying to send value from Cell(1,1) value 200 to Fatek Facon Server register R0 with using DDEPoke,but It send only first number from the cell (write only number 2).
I've tried a lot of options, but the result is always the same.
Does anyone know why this is happening?
This is code:

Option VBASupport 1
Sub Main
Cells(1, 1) = "200"
Channel = DDEInitiate("FaconSvr", "Channel0.Station0.Group0")
DDEPoke Channel, "R0", Cells(1, 1)
DDETerminate (Channel)
End Sub

Kind Regards
Milivoj
Attachments
Untitled.png
open office 4 windows 7 32bit
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: DDEPoke send only first number

Post by Zizi64 »

The DDE is a Microsoft related (VBA related) technology.

Try the LibreOffice. It has a littlebit higher compatibility with the VBA.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
JeJe
Volunteer
Posts: 2780
Joined: Wed Mar 09, 2016 2:40 pm

Re: DDEPoke send only first number

Post by JeJe »

Don't know about DDE but this ancient bug report seems to be the same issue - the responses are that DDE commands were depreciated already in 2005.

https://bz.apache.org/ooo/show_bug.cgi?id=39574
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
milivoj84
Posts: 2
Joined: Sat Dec 22, 2018 2:50 am

Re: DDEPoke send only first number

Post by milivoj84 »

Thanks for the answers but I would still like to use open office.
I forgot to mention that loading the registry from the facon server works ok.
I tried the new code without use VBASupport in code,but result is the same.Write obnly first number.

Sub Main

Dim nDDeChannel as Integer
Dim i as Integer
nDDeChannel = DDEInitiate("FaconSvr", "Channel0.Station0.Group0")
if nDDeChannel = 0 then
Print " Error Conection "
else
DDEPoke(nDDeChannel, "R0", "200")
i = DDERequest(nDDeChannel,"R0")
Print i
DDETerminateAll
end if

End Sub
open office 4 windows 7 32bit
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: DDEPoke send only first number

Post by Zizi64 »

nDDeChannel = DDEInitiate("FaconSvr", "Channel0.Station0.Group0")
Try it first with an another Calc ODF file as a target. Here is an example file from Andrew Pitonyak:

https://www.google.hu/url?sa=t&rct=j&q= ... xYIfgXnQ_X

Related problems:
viewtopic.php?f=9&t=22421
https://bz.apache.org/ooo/show_bug.cgi?id=39574
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply