Having issues since upgrading to Win 7 and 2013. Code looks like this. There also is a close routine, etc. I added in the open in safe mode to see if that would help. Any advice would be appreciated. %macro OpenXL; options noxwait noxsync; x ' "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.exe /s" '; data _null_; x=sleep(5); run; options noxwait noxsync missing=' '; filename sas2xl dde 'excel|system'; data _null_; length fid rc start stop time 8; fid=fopen('sas2xl','s'); if (fid le 0) then do; rc=system('start excel'); start=datetime(); stop=start+10; do while (fid le 0); fid=fopen('sas2xl','s'); time=datetime(); if (time ge stop) then fid=1; end; end; rc=fclose(fid); run; %mend; %macro OpenShell; filename cmds dde 'excel|system'; data _null_; file cmds; put '[error(false)]'; /*This suppresses errors that may occur if Excel is already open*/ put '[open("C:\Template.xlsx")]'; run; %mend; %macro write_header(actnum, period, sheetname, range); filename data dde "excel|&sheetname!&range" notab; data _null_; set details_&actnum(obs=1); file data lrecl=1000 stopover; put actnam; put actnum; put "&period"; put '12345'; put '12-3456789'; run; %mend;
... View more