BookmarkSubscribeRSS Feed
AmitKB
Fluorite | Level 6

Hi all,

            Is there a way to add an additional sheet to an already existing workbook.

     For example i have an excel file called  " DescriptiveStats.xls. Now I want to add a new work sheet called "FreqTab" to this workbook. It will have the result of a proc freq.

Thanks for your help.

Regards,

Amit

4 REPLIES 4
Reeza
Super User

I don't believe that's possible with Tagsets.Excelxp. That's partly because it doesn't create excel files, it creates XML files.

You can save the output from proc freq and then export it to the worksheet though.

OS2Rules
Obsidian | Level 7

Hi:


I don't think you can add a tab to the existing workbook with the ExcelXP tagset because the output is in xml format, not native xls format.

I would think the only way is to use SAS to read the exisiting spreadsheet, and then write this as tab 1 and the new data as tab 2, then convert the resulting output from xml back to xls.

SASKiwi
PROC Star

PROC EXPORT and LIBNAME EXCEL will both allow you to write an additional tab to existing Excel workbook. However the workbook would have to be in 'native' Excel format to do this (not XML). Easy to do by opening your existing workbook and doing a FILE SAVE AS to save in the right format.

You also need the SAS product SAS/ACCESS to PC FILE FORMATS licenced. PROC SETINIT will confirm this.

Quentin
Super User

If you are running on a PC and want to go old-school, DDE would be an option to consider as well.  See lexjansen.com for a bunch of papers on DDE magic by Koen Vyverman.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 3012 views
  • 0 likes
  • 5 in conversation