Ahh....row, column....that is a duh moment for me. I was thinking in terms of cell range rather than how DDE needs to reference the cell. Thanks Reeza, got it working I appreciate it! For anyone else that needs a solution like this, this is the code that works for me: /* Tell SAS to open Excel */ options noxwait noxsync; data _null_; rc=system('start excel'); rc=sleep(10); run; /* Execute VBA code via SAS DDE - open file, select sheet with pivot, put cursor on pivot table and refresh pivot table */ filename cmds dde 'excel|system'; data _null_; file cmds; put "[open(""\\&path\&f_name..xlsx"")]"; put '[workbook.activate("Pivot")]'; put '[select("R1C1")]'; put '[pivot.refresh()]'; put "[save()]"; put "[quit()]"; run; quit;
... View more