BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
4 REPLIES 4
deleted_user
Not applicable
Try this

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

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


GL
Oleg_L
Obsidian | Level 7
Hi,

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

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

Oleg.
deleted_user
Not applicable
Thank you both - these are both great ways to do it! Cheers!
Peter_C
Rhodochrosite | Level 12
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]

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 9567 views
  • 0 likes
  • 3 in conversation