I have written the following code to read data from word document. Everything is working fine except the last piece of code which is actually closing and quiting the word file.
I am not sure why the word file not getting closed , any help is greatly appreciated.
options noxwait noxsync symbolgen mlogic mprint;
x ' "D:\Program Files\Microsoft Office\Office12\winword" ';
data _null_;
z=sleep(5);;
run;
filename cmds dde "winword|system";
filename flname dde "winword|C:\Desktop\Test\ku046-2012-001 statistical analysis plan_final.docx!tbl" notab;
data _null_;
file cmds;
put '[FileOpen("C:\Desktop\Test\ku046-2012-001 statistical analysis plan_final.docx!lst")]';
run;
data pktable;
infile flname end=ee lrecl=1500;
input @1 string $3000.;
run;
data _null_;
file flname;
put '[FileClose 1)]';
put '[Quit()]';
run;
filename cmds clear;
filename flname clear;