From: "William W. Viergever" on
At 10:02 PM 6/28/2006, xamil wrote:
>Hi, folks:
>Is it possible to run a SAS (macro)program imbeded in
>VBA in Excel,


yes ... but think you be better off already haveing a SAS pgm
writtent and simpley call it from w/i Excel

>and run the SAS program by clicking the
>RUN command button created in Excel,

yes


>and output the result in Excel sheets ?

yes ... via DDE, export, Excel libnames, ODS, etc.


> Could anyone give me a simple example ?

no

:-)

i always go from sas to excel, so am unable to offer an example going
the other way

but

you could code some, i think, OLE, or whatever, stuff to call SAS

better yet, check out the MS Office add-in ... if all you want is to
grab some data in a SAS dataset and get itinto Excel ASAP





---------------------------------------------------
William W. Viergever
Viergever & Associates
Health Data Analysis / Systems Design & Development
Sacramento, CA 95825
william(a)viergever.net
(916) 483-8398
---------------------------------------------------
From: David on

> At 10:02 PM 6/28/2006, xamil wrote:
> >Hi, folks:
> >Is it possible to run a SAS (macro)program imbeded in
> >VBA in Excel,

Yes. Read the SAS manual:

Using SAS Software in your Operating Environment
Using SAS in Windows
Controlling SAS from Another Application using OLE under Windows
Examples of Automating SAS with OLE

For example (straight out of the manual):

Dim OleSAS As Object
Set OleSAS = CreateObject("SAS.Application")
OleSAS.Submit("libname insamp
'c:\sas\insight\sample';
proc insight data=insamp.drug;
run;")

To get data from SAS use ODBC.