OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

DDEPoke Macro just a little help?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Robuis
General User
General User


Joined: 23 Jan 2008
Posts: 6

PostPosted: Fri Jan 25, 2008 11:22 am    Post subject: DDEPoke Macro just a little help? Reply with quote

I am porting a macro to OO, what it needs to do is take the value of a cell and send that to my application via a DDE poke

This all most works.
Code:
Sub Poke0()
 Dim nDDEChannel As Integer
 dim document   as object
 dim x as string
 ODocument=ThisComponent
 x=ODocument.sheets(0).getcellByPosition(0,0).value
 nDDEChannel =DDEInitiate("kepdde", "Channel_1_Device_1")
 DDEPoke("1","K0", x )
 DDETerminate("1")
End Sub



The part that doenst work in this is if i write 123 to cell 0,0 it only sends a one?
500 and it sends a 5?

Can some one tell me what I'm doing wrong?
_________________
http://www.osdcm.com
Back to top
View user's profile Send private message Send e-mail
Crush4Size
Newbie
Newbie


Joined: 17 Oct 2006
Posts: 4

PostPosted: Tue Jan 29, 2008 4:57 pm    Post subject: Reply with quote

does x need to be a string?
Back to top
View user's profile Send private message
Crush4Size
Newbie
Newbie


Joined: 17 Oct 2006
Posts: 4

PostPosted: Tue Jan 29, 2008 5:23 pm    Post subject: Reply with quote

I did a little looking, I don't know if this ports directly to ooo.
Try Set method for x
Reference the variable nDDEChannel, rather than the value

Sub Poke0()
Dim nDDEChannel As Integer
dim document as object
dim x as string
ODocument=ThisComponent
Set x=ODocument.sheets(0).getcellByPosition(0,0).value
nDDEChannel =DDEInitiate("kepdde", "Channel_1_Device_1")
DDEPoke nDDEChannel,"K0", x
DDETerminate nDDEChannel
End Sub

I googxxx kepdde and found some sample stuff, hope it helps
Back to top
View user's profile Send private message
Robuis
General User
General User


Joined: 23 Jan 2008
Posts: 6

PostPosted: Wed Jan 30, 2008 6:22 am    Post subject: Thanks, but still cannot get it to work. Reply with quote

If I use:
Code:
Sub R0()
 Dim nDDEChannel As Integer
 dim document   as object
 dim x as string
 ODocument=ThisComponent
 Set x=ODocument.sheets(0).getcellByPosition(6,4).value
 nDDEChannel =DDEInitiate("kepdde", "Channel_1_Device_1")
 DDEPoke nDDEChannel,"K0", x
 DDETerminate("1")
End Sub

I get the error Object not accessible. Invalid object ref on the Set X line.
_________________
http://www.osdcm.com
Back to top
View user's profile Send private message Send e-mail
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Wed Oct 07, 2009 4:04 am    Post subject: Reply with quote

Hi,
After a Google search : see Issue 39574 : ddepoke only transmits first character

All DDE commands are indeed deprecated -> WONTFIX

______
Bernard
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group