DATA Step, Macro, Functions and more

how to change the background color of an excel sheet using sas dde

Reply
Senior User
Posts: 1

how to change the background color of an excel sheet using sas dde

I want to change the background color of an excel sheet from R1C1 to R1C10 in an excel sheet. On submitting the below code:

 

filename final dde 'excel|sheet1!r1c1:r1c10' ;
data _null_;
file final;
put '[patterns(1,0,15)]';
run;

 

the text  [patterns(1,0,15)] gets printed in the cell-R1C1, without any background color.

 

Thanks

Super User
Posts: 17,784

Re: how to change the background color of an excel sheet using sas dde

I don't have anything I can test this out on now, but I can see some issues.

You set the reference to your range but don't actually select it. Make sure to select the cells.
Once cells are selected try the pattern statement again.

If you search on lexjansen.com for a papers on DDE you'll find many references and examples.

A relevant one for you is here on the bottom of Page 3, with a demo of setting a range to a light grey.

http://www2.sas.com/proceedings/sugi27/p190-27.pdf

PS. DDE is considered very old school. If you can, consider using ODS Tagsets.ExcelXP or ODS Excel (SAS 9.4+) instead.
Ask a Question
Discussion stats
  • 1 reply
  • 252 views
  • 0 likes
  • 2 in conversation