Date: Wed, 31 Oct 2001 13:36:35 -0800
Reply-To: "William W. Viergever" <wwvierg@ATTGLOBAL.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "William W. Viergever" <wwvierg@ATTGLOBAL.NET>
Subject: Re: ERROR: Physical file does not exist, excel|[...
In-Reply-To: <B1D384A99B40D4118C1700D0B788102173704F@taz>
Content-Type: text/plain; charset="us-ascii"; format=flowed
Actually, you had the path *in* the brackets, which was the no-no.
Just the spreadsheet name goes in them, and as Rob, has pointed out, you
don't really need the path once the spreadsheet is opened.
Later
At 03:32 PM 10/31/2001 -0600, Workman, Rob wrote:
>Charles,
>
>I managed to get your code to work by removing the square brackets from the
>workbook name. In fact, it will work without the path in the filename
>statement. Hope this helps.
>
>Kind regards,
>
>Rob Workman
>
>SAS 6.12. Excel 2000
>
>*** This doesn't work;
>
>1143 filename xl dde 'excel|[c:\excel_xls\california.xls]!r1c1:r50c50';
>1144 data _null_;
>1145 file xl notab;
>1146 put '1' '09'x '2' '09'x '3';
>1147 put '1' '09'x '2' '09'x '3';
>1148 put '1' '09'x '2' '09'x '3';
>1149 run;
>
>ERROR: Physical file does not exist,
>excel|[c:\excel_xls\california.xls]!r1c1:r50c50.
>NOTE: The SAS System stopped processing this step because of errors.
>NOTE: The DATA statement used 0.05 seconds.
>
>*** This works without the square brackets;
>
>1158 filename xl dde 'excel|c:\excel_xls\california.xls!r1c1:r50c50';
>1159 data _null_;
>1160 file xl notab;
>1161 put '1' '09'x '2' '09'x '3';
>1162 put '1' '09'x '2' '09'x '3';
>1163 put '1' '09'x '2' '09'x '3';
>1164 run;
>
>NOTE: The file XL is:
> FILENAME=excel|c:\excel_xls\california.xls!r1c1:r50c50,
> RECFM=V,LRECL=256
>
>NOTE: 3 records were written to the file XL.
> The minimum record length was 5.
> The maximum record length was 5.
>NOTE: The DATA statement used 0.05 seconds.
>
>**** This works without the pathname.;
>
>1179 filename xl dde 'excel|california.xls!r1c1:r50c50';
>1180 data _null_;
>1181 file xl notab;
>1182 put '1' '09'x '2' '09'x '3';
>1183 put '10' '09'x '20' '09'x '30';
>1184 put '1' '09'x '2' '09'x '3';
>1185 run;
>
>NOTE: The file XL is:
> FILENAME=excel|california.xls!r1c1:r50c50,
> RECFM=V,LRECL=256
>
>NOTE: 3 records were written to the file XL.
> The minimum record length was 5.
> The maximum record length was 8.
>NOTE: The DATA statement used 0.05 seconds.
>
>
>
>-----Original Message-----
>From: charles.r.jones@CENSUS.GOV [mailto:charles.r.jones@CENSUS.GOV]
>Sent: Wednesday, October 31, 2001 3:03 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: ERROR: Physical file does not exist, excel|[...
>
>
>Following tips in texts by Vyverman, Workman, and others, I have managed
>to create an Excel workbook with multiple worksheets and to rename those
>worksheets. However, I'm getting an error when I setup to write data to one
>of the worksheets. In the following bit of simplified code, Excel starts
>and the spreadsheet opens. Then the error occurs.
>
>17670 %macro load2;
>17671 options noxwait noxsync;
>17672
>17673 * invoke the desired command line for wherever your .exe resides ;
>17674
>17675 x '"C:\Program Files\Microsoft Office\Office\excel.exe"'; * path for
>NT ;
>17676
>17677 * pause to give application a chance to start ;
>17678 data _null_;
>17679 x=sleep(4);
>17680 run;
>17681
>17682
>17683 filename excelcmd dde 'excel|system' ;
>17684
>17685 data _null_;
>17686 file excelcmd;
>17687 put '[open("d:\excel_xls\California.xls")]';
>17688 run;
>17689
>17690
>17691 filename csvout dde 'excel|[d:
>\excel_xls\California.xls]050-County!r1c1:r2000c3' notab
>17691! lrecl=6000;
>17692 libname intbls v8 'd:\excel_intbls\';
>17693
>17694 data _null_;
>17695 set intbls.estlbub;
>17696 file csvout;
>17697
>17698 put "Table ID" '09'x
>17699 "Order #" '09'x
>17700 "Description" '09'x
>17701 ;
>17702
>17703 put tblid '09'x
>17704 order '09'x
>17705 stub '09'x
>17706 ;
>17707 run;
>17708
>17709 %mend load2;
>17710 %load2;
>MLOGIC(LOAD2): Beginning execution.
>MPRINT(LOAD2): options noxwait noxsync;
>MPRINT(LOAD2): * invoke the desired command line for wherever your .exe
>resides ;
>MPRINT(LOAD2): x '"C:\Program Files\Microsoft Office\Office\excel.exe"';
>MPRINT(LOAD2): * path for NT ;
>MPRINT(LOAD2): * pause to give application a chance to start ;
>MPRINT(LOAD2): data _null_;
>MPRINT(LOAD2): x=sleep(4);
>MPRINT(LOAD2): run;
>
>NOTE: DATA statement used:
> real time 4.16 seconds
> cpu time 0.00 seconds
>
>
>MPRINT(LOAD2): filename excelcmd dde 'excel|system' ;
>MPRINT(LOAD2): data _null_;
>MPRINT(LOAD2): file excelcmd;
>MPRINT(LOAD2): put '[open("d:\excel_xls\California.xls")]';
>MPRINT(LOAD2): run;
>
>NOTE: The file EXCELCMD is:
> DDE Session,
> SESSION=excel|system,RECFM=V,LRECL=256
>
>NOTE: 1 record was written to the file EXCELCMD.
> The minimum record length was 37.
> The maximum record length was 37.
>NOTE: DATA statement used:
> real time 0.18 seconds
> cpu time 0.03 seconds
>
>
>MPRINT(LOAD2): filename csvout dde 'excel|[d:
>\excel_xls\California.xls]050-County!r1c1:r2000c3'
>notab lrecl=6000;
>MPRINT(LOAD2): libname intbls v8 'd:\excel_intbls\';
>NOTE: Libref INTBLS was successfully assigned as follows:
> Engine: V8
> Physical Name: d:\excel_intbls
>MPRINT(LOAD2): data _null_;
>MPRINT(LOAD2): set intbls.estlbub;
>MPRINT(LOAD2): file csvout;
>MPRINT(LOAD2): put "Table ID" '09'x "Order #" '09'x "Description" '09'x ;
>MPRINT(LOAD2): put tblid '09'x order '09'x stub '09'x ;
>MPRINT(LOAD2): run;
>
>ERROR: Physical file does not exist, excel|[d:
>\excel_xls\California.xls]050-County!r1c1:r2000c3.
>NOTE: The SAS System stopped processing this step because of errors.
>NOTE: DATA statement used:
> real time 0.07 seconds
> cpu time 0.04 seconds
>
>
>MLOGIC(LOAD2): Ending execution.
>
>
>_________________________________
>Charles Jones
>United States Census Bureau
>Demographic Surveys Division
>American Community Survey
>Continuous Measurement Office
>Room 1678-3
>Suitland, MD 20746 USA
>301.457.8054
------------------------------------------------------------
William W. Viergever Voice : (916) 483-8398
Viergever & Associates Fax : (916) 486-1488
Sacramento, CA 95825 E-mail : wwvierg@attglobal.net
------------------------------------------------------------
|