LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 25 Jul 2006 09:13:05 -0400
Reply-To:     Wensui Liu <liuwensui@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Wensui Liu <liuwensui@GMAIL.COM>
Subject:      Re: Export Graphs in Excel
Comments: To: bufino <>
In-Reply-To:  <>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

you can still use DDE. Here is an example I copy from my blog.

INSERT CHART INTO EXCEL USING DDE *********************************************************** * DEMO TO SHOW HOW TO CREATE & OUTPUT A CHART IN SAS * * AND INSERT IT INTO EXCEL USING DDE * ***********************************************************;

data one; do x = 1 to 10; y = x*x + rannor(123)*5; output; end; run;

filename plot 'C:\temp\plot.bmp';

goptions reset = global gsfname = plot gsfmode = replace cback = white device = emf xmax = 10 in hsize = 8.4 in ymax = 7 in vsize = 5.4 in; title height = 1.5 font = arial color = red box = 2 'A DEMO HOW TO EXPORT CHART FROM SAS AND PUT IT IN EXCEL'; symbol i = spline w = 2 c = blue cv = red h = 1 v = dot;

proc gplot data = one; plot y * x; run; title; quit;

options noxwait noxsync; x '"C:\Program Files\Microsoft Office\Office11\excel.exe"';

data _null_; x=sleep(1); run;

filename cmd dde 'excel|system'; filename label dde 'excel|sheet1!r1c1:r1c10'; filename data dde 'excel|sheet1!r2c1:r100c10';

data _null_; file cmd; put '[file.close(false)]'; put '[new(1)]'; put '[error(false)]'; put '["C:\temp\demo")]'; put '[app.maximize()]'; put '[workbook.insert(2)]'; put '[insert.picture("C:\temp\plot.bmp", 1)]'; run;

data _null_; set one; file label notab; put 'X' '09'x 'Y'; file data notab; put x 4.0 '09'x y 8.2; run;

*********************************************************** * END OF CODE * ***********************************************************;

On 7/25/06, bufino <> wrote: > Hello SAS People, > > I'd like to export SAS Graphs into excel. > > For exporting tables I usually use the DDE procedure. I was wondering > if there was a similar synatax for exporting graphs. > > Many Thanks, > Massimo >

-- WenSui Liu ( Senior Decision Support Analyst Health Policy and Clinical Effectiveness Cincinnati Children Hospital Medical Center

Back to: Top of message | Previous page | Main SAS-L page