BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a sas program to write data from sas into an existing EXCEL spreadsheet. I want to run "find" command in EXCEl through SAS DDE.

Here is the part of my program :


Put '[ERROR(false)]';
Put '[OPEN("'"&fname."'")]';
Put '[workbook.activate("'"&tname."'")]';
put '[SELECT("R90C28:R90C30")]';
put 'selection.find(200847)';

I keep getting error message like " DDE session not ready". I can't figure out why, as if I remove the last line of my program, it runs ok. Please help.

Thank you!
3 REPLIES 3
data_null__
Jade | Level 19
I "think" you need FORMULA.FIND. I was not able to test.

put '[formula.find(200847,2,1,1)]';
Syntax

FORMULA.FIND(text, in_num, at_num, by_num, dir_num, match_case)
FORMULA.FIND?(text, in_num, at_num, by_num, dir_num, match_case)
Text is the text you want to find. Text corresponds to the Find What box in the Find dialog box.
In_num is a number from 1 to 3 specifying where to search.

In_num Searches

1 Formulas
2 Values
3 Notes

At_num is the number 1 or 2 and specifies whether to find cells containing only text or also cells containing text within a longer string of characters.

At_num Searches for text as

1 A whole string (the only value in the cell)
2 Either a whole string or part of a longer string

By_num is the number 1 or 2 and specifies whether to search by rows or by columns.

By_num Searches by

1 Rows
2 Columns

Dir_num is the number 1 or 2 and specifies whether to search for the next or previous occurrence of text.

Dir_num Searches for

1 or omitted The next occurrence of text
2 The previous occurrence of text

Match_case is a logical value corresponding to the Match Case check box in the Find dialog box. If match_case is TRUE, Microsoft Excel matches characters exactly, including uppercase and lowercase; if FALSE or omitted, matching is not case-sensitive.

					
				
			
			
				
			
			
			
			
			
			
			
		
deleted_user
Not applicable
Thank you.

formula.find( ) works well in my situation.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 3 replies
  • 1881 views
  • 0 likes
  • 2 in conversation