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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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