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]

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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