DDEPoke send only first number

Creating a macro - Writing a Script - Using the API

DDEPoke send only first number

Postby milivoj84 » Sat Dec 22, 2018 3:10 am

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
milivoj84
 
Posts: 2
Joined: Sat Dec 22, 2018 2:50 am

Re: DDEPoke send only first number

Postby Zizi64 » Sat Dec 22, 2018 9:58 am

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

Try the LibreOffice. It has a littlebit higher compatibility with the VBA.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.4; AOO4.1.6
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.
User avatar
Zizi64
Volunteer
 
Posts: 8655
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: DDEPoke send only first number

Postby JeJe » Sat Dec 22, 2018 11:49 am

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
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 693
Joined: Wed Mar 09, 2016 2:40 pm

Re: DDEPoke send only first number

Postby milivoj84 » Sat Dec 22, 2018 2:08 pm

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
milivoj84
 
Posts: 2
Joined: Sat Dec 22, 2018 2:50 am

Re: DDEPoke send only first number

Postby Zizi64 » Sat Dec 22, 2018 2:38 pm

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; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.4; AOO4.1.6
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.
User avatar
Zizi64
Volunteer
 
Posts: 8655
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Macros and UNO API

Who is online

Users browsing this forum: JeJe and 5 guests