Santos,
I couldnt get to work on the task we discussed so far.I tried the solution that you provided,but it still looks like the worksheet name is not being changed.
I'm succesful to the part of changing the file name programactially,
SASPhile.
This is what I used to change the file name only!
Did not know how to proceed to change the worksheet name.
options noxwait;
%let my_dir=T:\NovoLand\sspr\Redistribution Data (SP and WK data)\Raw Data\MonthlyInputfiles;
data _null_;
dir_cmd='dir "'||"&my_dir"||'"';
rc=filename('dir',dir_cmd,'pipe');
run;
data d;
infile dir pad truncover;
input date $10.@;
if date ='' or date='Volume' or length(date) <10 then delete;
else input time $ ampm $ dir $ name $200.;
if trim(dir)='' then delete;
if index(name,'GH Utilization') then do;
nm='IVSOLUTIONS';
cmd='ren "'||"&my_dir\"||trim(left(name)) ||'" "'||compress(left(nm)||'_'||year(today())||'_'||put(month(today())-1,z2.)||'.xls"') ;
put cmd=;
rc=system(cmd);
end;
run;
Just to support you.
I did not find the solution of changing the worksheet name in MS Excel of versions 97 - 2003.
But for output reports that need changing of worksheet name i use Excel 95.
All macrofunctions of Excel work nice through DDE in Excel 95.
Daniel,
can you put a simple example of code that works on Excel 2003.
The code that renames "sheet1" to "new" in already opened "Book1".
I know the only way is VBA macro running from SAS.
But i don't know VBA, so I have difficulties with Excel 2003.
Hi Lu,
How to make the index search which is not case sensitive?
if index(name,'GH Utilization') then do;
sas code
end;
here 'GH Utilization' can be in any case..upper, lower ,mixed or Prop case.
I would say the answer is YES - FIND provides functionality that INDEX does not, specifically case-blind, given the third argument. Have a look at the DOC: