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!

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