[R] rcom close Excel problem
stenka1 at go.com
Mon Dec 17 15:35:50 CET 2007
Thank you, getobject is a roundabout, but solves the issue. BTW I
system("taskkill /f /im Excel.exe") # kills the process just fine.
The second problem is not due to the backslash vs slash, you can try
and see that using the forward slash works fine from ESS. The q. is how
to submit a second argument to "Close"?
Submitting a second argument to Open works fine as shown by the "0"
below, but neither "1" nor "-1" worked for Close. Very strange.
From: cskiadas at gmail.com
Date: 12/14/2007 18:57
To: "stephen bond"<stenka1 at go.com>
Cc: <r-help at r-project.org>
Subj: Re: [R] rcom close Excel problem
I know it won't answer your question exactly, but using comGetObject
instead of comCreateObject won't create new Excel instances, so at
least you won't have more than one processes running, so this might
solve some of your problems.
As for your second problem, I would venture to guess you need your
paths with double backslashes instead of slashes. The following just
worked over here:
\Documents and Settings\\Haris\\Desktop\\test1.xlsx")
Department of Mathematics and Computer Science
On Dec 14, 2007, at 2:58 PM, stephen bond wrote:
> I just discovered that I cannot close the Excel application and task
> manager shows numerous copies of Excel.exe
> I tried both
> x$Quit() # shown in the rcom archive
> and Excel refuses to die.
> Thank you very much.
> "You can't kill me, I will not die" Mojo Nixon
> I also have a problem with saving. It produces a pop-up dialog and
> not take my second parameter:
> xls", "0")
> sh<-comGetProperty(wb,"Worksheets","Market Data")
> range1 <- comGetProperty(sh,"Range","C10","I11")
> vals <- comGetProperty(range1,"Value")
> comInvoke(wb,"Close","G:/MR/Stephen/repo.xls","True") # True is
> Thank you All.
More information about the R-help