Re: [R] rcom close Excel problem

From: Charilaos Skiadas <cskiadas_at_gmail.com>
Date: Fri, 14 Dec 2007 21:57:04 -0500

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:

  wb<-comInvoke(comGetProperty(obj,"Workbooks"),"Open", "C:\ \Documents and Settings\\Haris\\Desktop\\test1.xlsx")

Haris Skiadas
Department of Mathematics and Computer Science Hanover College

On Dec 14, 2007, at 2:58 PM, stephen bond wrote:

> Hello,
>
> 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
>
> x$Exit()
>
> and Excel refuses to die.
> Thank you very much.
> S.
>
> "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
> does
> not take my second parameter:
>
> x<-comCreateObject("Excel.Application")
> wb<-comInvoke(comGetProperty(x,"Workbooks"),"Open","G:
> /MR/Stephen/repo.
> 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
> ignored
>
> Thank you All.
> Stephen



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 15 Dec 2007 - 03:03:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 15 Dec 2007 - 03:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.