Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
TarkenKalia
Newbie


Joined: 25 Jan 2008
Posts: 7

PostPosted: Fri Jan 25, 2008 3:43 pm   

#DDE working with Excel
 
What I'm trying to do is use the #DDE function so that I could get zMUD (7.21) to work with Microsoft Excel (2007) on a non-2007 file (so it's still xls). I've looked all across the net for some solutions and the application's documentation isn't very helpful imho.
I've tried

#NOOP %dde("Excel","C:\zmud721\test.xls","R1C1")
and
#CALL %dde("Excel","C:\zmud721\test.xls","R1C1")

yet zMUD returns nothing. I've tried numerous ways of doing the filepath as well, such as putting it in the zmud folder and not specifying drive, etc. I have tried it with the spreadsheet opened and closed and still no luck. Can anyone shed some light please? I know DDE is quite an advanced feature.

-Thanks
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Jan 27, 2008 2:35 am   
 
I know this isn't what you asked about, but just incase you overlooked it.
Have you considered using COM to allow zMUD to interact with with Excel?
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Jan 27, 2008 3:42 am   
 
Okay I poked around and this is what I found.
First Excel has to be open.
to open a specific file you can do
Code:
#call %ddemacro("Excel","System",'[OPEN("C:\zmud721\test.xls")]')

For me on the third argument the single quotes ' had to be the external quotes
This should open file you want.
Then to get the Data you use
Code:
 #show %dde("EXCEL","Sheet1","R1C1")

or whatever the Sheetname and Cell you want to get.
Code:
#call %ddepoke("EXCEL","Sheet1","R1C2","Put Some Stuff here")

To put stuff
and
Code:
#call %ddemacro("Excel","System",'[SAVE()]')
#call %ddemacro("Excel","System",'[CLOSE()]')

to save it and close that worksheet when you're done.

Hope this helps.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
TarkenKalia
Newbie


Joined: 25 Jan 2008
Posts: 7

PostPosted: Sun Jan 27, 2008 8:00 am   
 
Excellent. Absolutely amazing. Thank you very much.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Jan 27, 2008 3:10 pm   
 
No problems.
If you want to completely automate the process, may I suggest using the launch command to open Excel
Code:
#LAUNCH {C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE}

and using the quit Macro to quit excel when you're done.
Code:
#call %ddemacro("Excel","System",'[QUIT()]')


The DDE macros for Excel seem to be mostly from something called Excel Version 4.0 Macro Language
You can download a Microsoft help file for that here
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
TarkenKalia
Newbie


Joined: 25 Jan 2008
Posts: 7

PostPosted: Sun Jan 27, 2008 9:42 pm   
 
Ah yeah thanks
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net