05-21-2015 04:12 PM
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"';|
|z=sleep(3); *Forces SAS to sleep for 3 seconds while Excel opens;|
|filename ddecmds DDE "excel|sheet1!c1c7";|
|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")]';|
05-21-2015 04:25 PM
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*/
And a third place is I had to explicitly address the file format to match the version of Excel in a save command.
05-21-2015 07:41 PM
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?