DATA Step, Macro, Functions and more

Macro variable for opening Excel file with DDE

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Macro variable for opening Excel file with DDE

[ Edited ]

Hello,

 

I would like to open dynamically Excel files using DDE and Macro Variables.

This is my code :

 

FILENAME xlAppli DDE "Excel|System" ;
SYSTASK COMMAND "Start Excel" ; DATA _NULL_ ; CALL SLEEP(3,1) ; RUN ; %let region=bretagne; data _null_; file xlAppli; put '[error(false)]'; put '[open(""C:\Users\Desktop\&region..xls"")]'; run;

But it happens nothing.

 

Can someone help please?

 

Thank you.


Accepted Solutions
Solution
‎03-24-2017 05:02 AM
Occasional Contributor
Posts: 7

Re: Macro variable for opening Excel file with DDE

Thanks I found the solution, I had to replace outer single quotes with double quotes :

SYSTASK COMMAND "Start Excel" ;
FILENAME xlAppli DDE "Excel|System" ;
DATA _NULL_ ;
     CALL SLEEP(3,1) ; 
RUN ;

%let region=bretagne;
data _null_;
file xlAppli;
put '[error(false)]';
put "[open(""C:\Users\Desktop\&region..xls"")]";
run;

Thanks!

View solution in original post


All Replies
Solution
‎03-24-2017 05:02 AM
Occasional Contributor
Posts: 7

Re: Macro variable for opening Excel file with DDE

Thanks I found the solution, I had to replace outer single quotes with double quotes :

SYSTASK COMMAND "Start Excel" ;
FILENAME xlAppli DDE "Excel|System" ;
DATA _NULL_ ;
     CALL SLEEP(3,1) ; 
RUN ;

%let region=bretagne;
data _null_;
file xlAppli;
put '[error(false)]';
put "[open(""C:\Users\Desktop\&region..xls"")]";
run;

Thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 146 views
  • 1 like
  • 1 in conversation