SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Direct Read of open Excel-Sheet within Add-In for Microsoft Office (Office Analytics)

Reply
Occasional Contributor
Posts: 5

Direct Read of open Excel-Sheet within Add-In for Microsoft Office (Office Analytics)

Hi

How can I easily read an open Excel-sheet out of the SAS-Program-window of the Excel-SAS Addin? Is there any Statement which I can use instead of "Active Excel Sheet" that works (see attached Screenshot). I know I could save the Excel-sheet, attach it with a library (libname XXX Excel "...") and then read it.

 

But is there any way to do it without saving the sheet (like the predefined statistic routines do it in the Addin).

 

Thnaks

Karl

Super User
Super User
Posts: 9,599

Re: Direct Read of open Excel-Sheet within Add-In for Microsoft Office (Office Analytics)

Not really, it would involve a fair bit of work to get the various plugins talking to each other and returning results.  Is importing the file too dificult?  If so its unlikely your going to find a simpler solution.  One thing I can suggest is that with (assumes you have SAS 9.4) libname excel and and xlsx file then you can set a libname to a file, thats a bit simpler, e.g.:

libname xl xlsx "<pathtoyourfile>/<yourfile>.xlsx";

data want;
  set xl.sheet1;
run;

libname xl clear;

The libname will show all the usable tabs in the workbook (if you goto library explorer you can actually see them).

Occasional Contributor
Posts: 5

Re: Direct Read of open Excel-Sheet within Add-In for Microsoft Office (Office Analytics)

Thank you RW9  for your answere! 

No saving and importing is not really an issue.

Sincerly Karl

Ask a Question
Discussion stats
  • 2 replies
  • 167 views
  • 0 likes
  • 2 in conversation