BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aamoen
Obsidian | Level 7

Hello, I'm running the following program and running into an issue within excel.  When SAS processing the line put '[formula.fill("=SUM(U2:U299)/1000")]'; excel gives me the following message.  Not sure where I'm going wrong here..  Thanks!

 

aamoen_0-1626446231167.png

 

 

 

Filename cmds dde 'excel|system';
Data _null_;
File cmds;
Put '[workbook.activate("MB")]';
Put '[select("R300C20")]';
put '[formula.fill("Sum of Acquisition Cost and Carrying Value")]';

put '[select("R301C20")]';
put '[formula.fill("From Sch A, col A, line M.2 & Sch A, col D, line M.2")]';

put '[select("R302C20")]';
put '[formula.fill("Check, must be zero")]';

put '[select("R300C21")]';
put '[formula.fill("=SUM(U2:U299)/1000")]';

put '[select("R300C66")]';
put '[formula.fill("=SUM(BN2:BN299)/1000")]';

put '[select("R301C21")]';
put '[formula.fill("='Schedule A'!G16")]';

put '[select("R302C21")]';
put '[formula.fill("=U300-U301")]';

put '[select("R301C66")]';
put '[formula.fill("='Schedule A'!J16")]';

put '[select("R302C66")]';
put '[formula.fill("=BN300-BN301")]';

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
I think formula.fill is correct but don't you need to use the RC notation, not the cell reference notation for DDE?

See page 14 here
https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/022-31.pdf

View solution in original post

5 REPLIES 5
Reeza
Super User
I think formula.fill is correct but don't you need to use the RC notation, not the cell reference notation for DDE?

See page 14 here
https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/022-31.pdf
Reeza
Super User
And formula.fill appears to have two parameters - one is the formula, the second appears to be the range it should fill, which makes sense given the FILL.

aamoen
Obsidian | Level 7
Okay. I thought the put, select directly above determined the cell within excel to fill the formula.

put '[select("R300C21")]';
put '[formula.fill("=SUM(U2:U299)/1000")]';
Reeza
Super User
You'll have to check the documentation then, I'm making an educated guess based on the code I've seen.
Are you sure you can't use ODS EXCEL instead of DDE?
aamoen
Obsidian | Level 7
yep, that was it. Need to use the RC notation, not the cell reference.

Thank you!

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
  • 5 replies
  • 1899 views
  • 2 likes
  • 2 in conversation