DATA Step, Macro, Functions and more

Query excel to find sheet name

Reply
N/A
Posts: 0

Query excel to find sheet name

Hi All

I was just wondering if there is a function or DDE query I can run to find the sheet names within Excel? E.G. Book1.xls contains Sheet1 Sheet2 Sheet3.

I have a client that sends me weekly updates but always calls the sheet name something different. I have asked him not to but he continues to change it.

Thanks
N/A
Posts: 0

Re: Query excel to find sheet name

Try this

libname xls excel 'c:\test.xls';

data t;
set sashelp.vtable;
where libname = 'XLS';
run;


GL
Regular Contributor
Posts: 151

Re: Query excel to find sheet name

Hi,

Mr. Data _null_ provided very good solution a year ago:

http://support.sas.com/forums/thread.jspa?messageID=23307嬋

Oleg.
N/A
Posts: 0

Re: Query excel to find sheet name

Thank you both - these are both great ways to do it! Cheers!
Valued Guide
Posts: 2,175

Re: Query excel to find sheet name

Neil

just to dig a little into the dictionary tables, you may find the engine column of dictionary.members useful when working with more than one workbook (or libname) .... Try code:[pre] proc sql ;
create table sheets as select * from dictionary.members where engine= 'EXCEL' ;
quit ;[/pre]
Ask a Question
Discussion stats
  • 4 replies
  • 4366 views
  • 0 likes
  • 3 in conversation