BookmarkSubscribeRSS Feed
SASuserlot
Barite | Level 11

I am looking to combine all the excel files in folder starts with a specific into one file ( use each individual excel file as sheet in combine file) after combination delete individual files.  I am looking to do it instead of importing them back into SAS datasets and doing proc report. Is there a way I can do it through  using  xCMD or vbscript code running through the SAS. Thank you.

SASuserlot_0-1669066161549.png

 

3 REPLIES 3
Reeza
Super User
If they're all in one folder here's a script. https://www.codeproject.com/Tips/5264786/Merge-Many-Excel-Files-into-one-VBS
Last one on the page. I'd modify it to not use prompts and to have SAS pass the folder name.
Note that it combines all in a folder.

SASuserlot
Barite | Level 11

thank you @Reeza . I will work on this. Will let you know if I encounter issues or need any updates.

SASuserlot
Barite | Level 11

Hi @Reeza , I trying to use it, But I am struggling how to use the VBA code in SAS. Can you please provide some startup code to start on it.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 1293 views
  • 2 likes
  • 2 in conversation