Hi,
Looking through Art Carpenter's Innovative SAS Techniques, on page 7 he shows a technique for updating a sheet in an excel workbook. In this example he used an Office 97/2003 type workbook (.xls).
Tried to duplicate this with a current style workbook in Windows SAS 9.2 and got an error.
- I created a test workbook (test.xlsx) with a single sheet named 'test'.
- I then used the following libname to get to it:
libname testx excel '...path to sheet\test.xlsx' scan_text=no; - Ran a proc datasets to delete the file (had to use a $ after the name--it couldn't find the sheet name just as 'test'):
proc datasets library=testx nolist;
delete 'test$'n;
quit; - Then used a simple data step to try to replace it:
data testx.'test$'n;
set temp;
run;
The error I got back was:
ERROR: The MS Excel table test$ has been opened for OUTPUT. This table already
exists, or there is a name conflict with an existing object. This table
will not be replaced. This engine does not support the REPLACE option.
NOTE: The SAS System stopped processing this step because of errors.
Suggestions?
Thanks much!
--Ben