BookmarkSubscribeRSS Feed
CWesselman
Calcite | Level 5

I have developed the following code which was working on SAS 9.2, but is now not working on SAS 9.3:

x '"C:\Program Files (x86)\Microsoft Office\Office14\excel.exe"';

data _null_;
z=sleep(3); *Forces SAS to sleep for 3 seconds while Excel opens;
run;

filename ddecmds DDE "excel|sheet1!c1c7";
data _null_;
file ddecmds;
put '[workbook.activate("Sheet1")]';
put '[page.setup("&B&14&""Calibri""Supplemental Kit Evaluation Report (20 Samples)","Page &P",0.25,0.25)]';
put '[insert.picture("\\cpcsrv2\bdm\stats\iC42\Supplemental 20\Programs\ic42 logo6.bmp")]';
put '[format.size(476,80)]';
put '[select("C1")]';
put '[Column.Width(4)]%';
put '[select("C2")]';
put '[Column.Width(12)]%';
put '[select("C3")]';
put '[Column.Width(24)]%';
put '[select("C4:C6")]';
put '[Column.Width(12)]%';
put '[select("C7")]';
put '[Column.Width(13)]%';
run;

Any suggestions?

3 REPLIES 3
ballardw
Super User

By any chance are you running Cisco Jabber? That, and possibly  a few other applications, interfere with DDE commands. If so, shut down Jabber. THEN use Task Manager to KILL the process still running.

I had some issues using the X command, which you may have an admin preventing you from using, to start Excel.

I use (with my very limited DDE experience)

%let rc=%sysfunc(system(start Excel));

   /* wait to make sure excel is done starting, the number is seconds of delay

      the value can be smaller for faster disk drives*/

   %let rc=%sysfunc(sleep(2));

And a third place is I had to explicitly address the file format to match the version of Excel in a save command.

CWesselman
Calcite | Level 5

Most of my DDE commands later in the program are working. The X command is working fine. And the save command is working.

Reeza
Super User

So which lines aren't running? Break it up and run it either line by line or binary search to see where the issue is.

My first check would be that the macro variables are resolving properly.

Is it the same version of Excel?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 1416 views
  • 0 likes
  • 3 in conversation