BookmarkSubscribeRSS Feed
BigPete
Obsidian | Level 7

Although this thread (https://communities.sas.com/t5/SAS-Programming/Copy-Excel-file-from-one-folder-to-another/m-p/418901...) was helpful about how to copy an Excel file from one folder to another with SAS, is there a way to copy a specific sheet in an Excel file with multiple sheets to another folder with SAS? I'm using SAS 9.4.

3 REPLIES 3
PaigeMiller
Diamond | Level 26

You could read the sheet into a SAS data set and then use SAS to write a brand new spreadsheet in another folder. CAUTION: not all features in Excel can be copied this way.

--
Paige Miller
BigPete
Obsidian | Level 7

@PaigeMiller but any idea how to preserve original formats?

 

Any idea how to keep this appearance into the target copy?

BigPete_0-1684792879118.png

 

Don't want the copy to look like this:

BigPete_1-1684792957331.png

 

And any idea if there's a way in SAS to extract a specific sheet in a multi-sheet Excel file and copy each into separate Excel files?

BigPete_2-1684793129964.png

 

PaigeMiller
Diamond | Level 26

If you really have to preserve the formats, then look at Visual Basic. I don't think that SAS is the right tool for this.

--
Paige Miller

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 235 views
  • 1 like
  • 2 in conversation