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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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