Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Excel and SPSS data/syntax

333 views
Skip to first unread message

alphapoint05

unread,
Oct 3, 2005, 1:07:41 PM10/3/05
to
I have Excel VBA code that opens and passes a worksheet to SPSS. This
has not been a problem. Right now, Excel now tells the user to open and
run a file called Run.sbs once SPSS opens. I would like to skip this.
In other words, how would I program Excel to open SPSS and then run the
syntax with no user operations?

Thanks,
Jeff Miller

alphapoint05

unread,
Oct 3, 2005, 1:18:57 PM10/3/05
to
My apologies, it's Run.sps not Run.sbs

Tom

unread,
Oct 3, 2005, 4:00:07 PM10/3/05
to
alphapoint05 wrote...

> I have Excel VBA code that opens and passes a worksheet to SPSS. This
> has not been a problem. Right now, Excel now tells the user to open and
> run a file called Run.sps once SPSS opens. I would like to skip this.

> In other words, how would I program Excel to open SPSS and then run the
> syntax with no user operations?


You will probably want only the last line...

Set SPSSApp = CreateObject("SPSS.Application")
Set SPSSDoc = SPSSApp.NewDataDoc ' or SPSSApp.OpenDataDoc("c:\file.sav")
SPSSDoc.Visible = True
SPSSApp.ExecuteInclude "c:\mysyntax.sps", True

alphapoint05

unread,
Oct 4, 2005, 12:24:03 PM10/4/05
to
Ok, SPSS opens but only part of the syntax runs.

The syntax code is

INSERT FILE = "c:\folder4SPSS\DefineGlobals.sps".
INSERT FILE = "c:\folder4SPSS\BringInTheExcelData.sps".
SCRIPT "c:\folder4SPSS\MainProgram.sbs".
EXECUTE.

The globals insert must be working because the Excel data shows up in
the Data Editor as requested in the second insert. But, when it gets to
the MainProgram script, a combo box should appear. SPSS just hangs with
a message at the bottom reading "Script Running". It's as if it is
waiting for a user selection but there is nothing to be seen but the
data.

Any ideas?

Jeff

neila...@msn.com

unread,
Oct 4, 2005, 2:31:31 PM10/4/05
to
Jeff,

SCRIPT "c:\folder4SPSS\MainProgram.sbs".

What is in this file? How bout showing us the dirty bits ;-)
Neila

alphapoint05

unread,
Oct 6, 2005, 2:55:42 AM10/6/05
to
I wish I could, but I'd rather keep my job. Either way, the contents of
the script shouldn't affect my ability to run it from Excel. I have no
problem running the syntax which then calls the script. Is the problem
due to Excel calling the syntax to call the script?

neila...@msn.com

unread,
Oct 6, 2005, 5:33:47 PM10/6/05
to
Jeff,
Any number of weird things can happen when you mix syntax and
scripts.
Like I said, show us the dirty bits. I am going out of the ESP
business!
You'll probably stand a better chance of keeping your job if you can
figure
out how to solve your programming problems. What do you want, a
freaking NDA. I bill my time at $125.00 USD per hour. You want me to
get on for the ride I'll sign your NDA and probably spoof out your
gremlins
in about an hour.
Meanwhile check for cases where you are running syntax using
objspssapp.executecommands syntax, TRUE .
The TRUE (bsynch) will bite you in the butt if you are calling such
from syntax.
HTH, Neila

0 new messages