1

I want to manipulate an existing Excel sheet with DDE using SAS:

I have the following code (be careful! I use z for r(ows) and s for c(columns) because of German language settings in Excel):

option noxwait noxsync;
x call "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE";

%let delay=5;

data _null_;
rc=sleep(&delay); 
run;

filename sas2xl dde 'excel|system';

data _null_;
rc=sleep(&delay);
run;

%let mapwkbk=H:\odstest.xlsx;

data _null_;
file sas2xl;
rc=sleep(&delay);
put '[open("' "&mapwkbk" '")]';
run;


filename random dde 'excel|Daten!z2s1:z100s3';
data _null_;
    set sashelp.class;
    file random;
    put name sex age;
run;


data _null_;
file sas2xl;
/*rc=sleep(&delay);*/
put '[workbook.select("Pivot")]';
put '[select("Z2S1")]';
put "[pivot.refresh()]"; 

put '[workbook.select("Daten")]';
put '[select("z1S2:z1s5")]';
put '[filter]';
put '[select("z1S10")]';
put '[filter]';

put '[column.width(0,"s1",false,1)]';
put '[column.width(0,"s6:s9",false,1)]';

put '[workbook.delete("Dim")]';

/*put "[save()]";*/
/*put "[quit()]";*/
run;

Now I would like to collapse some columns of the pivot table. How to reach this?

zuluk
  • 1,557
  • 8
  • 29
  • 49
  • 1
    I won't repeat my answer from your other question, but it would be identical. – Joe Nov 14 '17 at 21:09

0 Answers0