BookmarkSubscribeRSS Feed
anirban_chakra
Calcite | Level 5

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

1 REPLY 1
Reeza
Super User
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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 2507 views
  • 0 likes
  • 2 in conversation