BookmarkSubscribeRSS Feed
Raitag
Fluorite | Level 6
Hey everyone !
I 'm trying to export some data from sas to excel using dde. Here is my code :

Options noxwait noxsync ;
X ' start excel' ;

Data _null_ ;
Rc = sleep(3);
Run ;
/* openning my xls file : note that i created a xls file */

Filename export dde "excel|system" ;
Data _null_ ;
File export ;
Put '[open("filepath\filename.xls")]';
Run ;

/*Selecting the range in my xls file where to export data */

Filename range dde "excel|sheet1! R1c1:r2c67" ;

Data _null_ ;
Set sashelp.workers ;
File range ;
Put date electric /* columns to export */ ;
Run ;


When i open my xls file nothing is exported,the file is empty but the log says that everything is exported as it should be. I can't figure why, can you help me ?

Ps : i work with sas 9.1 and excel 2007 ( the file is a xlsx saved as xls)

Thank you for your help.

2 REPLIES 2
Tom
Super User Tom
Super User

You have a command to open the file, but I don't see one to save the file.

Patrick
Opal | Level 21

@Raitag

Before implementing new code using DDE you probably should read this article:

https://blogs.sas.com/content/sasdummy/2014/10/14/dde-is-doa/  

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1137 views
  • 0 likes
  • 3 in conversation