Date: Sun, 17 Oct 2010 08:52:40 -0700
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: DDE Save As Problem
Content-Type: text/plain; charset=ISO-8859-1
Buddi,
As I mentioned, I can't test Office 2007 code, but have you tried
SaveAs rather than save.as?
Art
------------
On Oct 17, 10:28 am, Arthur Tabachneck <art...@netscape.net> wrote:
> Buddi,
>
> Your code works correctly on my system, although I was only able to
> test it using the xls extension for office 2003. I'm not familiar
> with the newer versions of Excel as yet.
>
> The only potential problem I noticed in your code was that you refer
> to a wrk directory. Does such a directory exist or had you meant to
> type work?
>
> Art
> --------------
> On Oct 17, 7:37 am, Buddi <venumadhav.gadir...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I have written the below code to copy created data in to a template
> > that has graph, and save it as different excel sheet. when i just save
> > it, it is getting saved and code is working fine...but when I save as
> > with different name, it is throwing error that is not easy to
> > understand for me. please help me in this.
>
> > options noxwait noxsync;
> > X ' "C:\Program Files\Microsoft Office\Office12\excel.exe " ';
>
> > data _null_;
> > x = sleep(10);
> > run;
>
> > FILENAME commands DDE "EXCEL|SYSTEM";
>
> > data _null_;
> > file commands;
> > PUT "[OPEN(""C:\Temp\Reports\AHTTemplate.xlsx"")]";
> > x=sleep(3);
> > run;
>
> > FILENAME ddedata DDE
> > "excel|[AHTTemplate.xlsx]AHT!r2c2:r13c3"
> > RECFM=V LRECL=25000
> > notab;
>
> > FILENAME DDECMDS DDE "EXCEL|SYSTEM";
>
> > data _null_;
> > set wrk.aht_care;
> > file ddedata;
> > put avg_AHT '09'x avg_sal '09'x;
> > run;
>
> > FILENAME DDECMDS DDE "EXCEL|SYSTEM";
>
> > DATA _null_;
> > FILE DDECMDS;
> > x=sleep(3);
> > put '[error(false)]';
> > PUT '[SAVE.as("C:\Temp\ahtcare.xlsx")]';
> > PUT " [quit()] ";
> > run;
>
> > filename ddecmds clear;
> > filename ddedata clear;
>
> > error : ERROR 22-322: Syntax error, expecting one of the following: a
> > name, an integer constant,
> > arrayname, #, $, &, (, +, /, //, :, ;, ?, @, @@,
> > OVERPRINT, _ALL_, _BLANKPAGE_,
> > _ODS_, _PAGE_, ~.- Hide quoted text -
>
> - Show quoted text -
|