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/  

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 885 views
  • 0 likes
  • 3 in conversation