Re: [R] Physically open Excel file from R

2010-02-08 Thread S Ellison
Try
shell('\"file.xls\"')

where 'file.xls' is the excel filename.

The escaped quotes (\") are not strictly necessary if the filename contains no 
spaces, but they are essential if it does.



>>> Sergey Goriatchev  08/02/2010 12:48:20 >>>
Hello, everyone

I wonder if it is possible to PHYSICALLY open an Excel file from R.
The reason I ask is, I produce regularly an Excel file in R, and then
I want to make it look good, so I have a VBA routine in another Excel
file that works on the regular Excel file.
This formatting file executes VBA code on open, so all I need to do is
physically open it (no reading/writing at all). I wonder if that can
be done from R, so that I do as little as possible manually.

Thanks in advance for help!
Regards,
Sergey
--
Simplicity is the last step of art./Bruce Lee

Kniven skärpes bara mot stenen.

__
R-help@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.

***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@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.


Re: [R] Physically open Excel file from R

2010-02-08 Thread Sergey Goriatchev
Dear Uwe,

Worked as a charm! :-)
Thank you kindly.

Now, after I've run the VBA with shell.exec(), and closed the formater
and the formatted file, I still have Excel shell (=Excel with no files
open) open. Is it possible to close it from R as well?

Best,
Sergey

2010/2/8 Uwe Ligges :
>
>
> On 08.02.2010 13:48, Sergey Goriatchev wrote:
>>
>> Hello, everyone
>>
>> I wonder if it is possible to PHYSICALLY open an Excel file from R.
>> The reason I ask is, I produce regularly an Excel file in R, and then
>> I want to make it look good, so I have a VBA routine in another Excel
>> file that works on the regular Excel file.
>> This formatting file executes VBA code on open, so all I need to do is
>> physically open it (no reading/writing at all). I wonder if that can
>> be done from R, so that I do as little as possible manually.
>
>
> If you are under Windows and Excel is installed properly,
>
> shell.exec("filename")
>
> should do the trick.
>
> Uwe Ligges
>
>
>> Thanks in advance for help!
>> Regards,
>> Sergey
>> --
>> Simplicity is the last step of art./Bruce Lee
>>
>> Kniven skärpes bara mot stenen.
>>
>> __
>> R-help@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.
>



-- 
Simplicity is the last step of art./Bruce Lee
The more you know, the more you know you don't know. /Myself

I'm not young enough to know everything. /Oscar Wilde
Experience is one thing you can't get for nothing. /Oscar Wilde
When you are finished changing, you're finished. /Benjamin Franklin
Luck is where preparation meets opportunity. /George Patten

Kniven skärpes bara mot stenen.

__
R-help@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.


Re: [R] Physically open Excel file from R

2010-02-08 Thread Uwe Ligges



On 08.02.2010 13:48, Sergey Goriatchev wrote:

Hello, everyone

I wonder if it is possible to PHYSICALLY open an Excel file from R.
The reason I ask is, I produce regularly an Excel file in R, and then
I want to make it look good, so I have a VBA routine in another Excel
file that works on the regular Excel file.
This formatting file executes VBA code on open, so all I need to do is
physically open it (no reading/writing at all). I wonder if that can
be done from R, so that I do as little as possible manually.



If you are under Windows and Excel is installed properly,

shell.exec("filename")

should do the trick.

Uwe Ligges



Thanks in advance for help!
Regards,
Sergey
--
Simplicity is the last step of art./Bruce Lee

Kniven skärpes bara mot stenen.

__
R-help@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.


__
R-help@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.


[R] Physically open Excel file from R

2010-02-08 Thread Sergey Goriatchev
Hello, everyone

I wonder if it is possible to PHYSICALLY open an Excel file from R.
The reason I ask is, I produce regularly an Excel file in R, and then
I want to make it look good, so I have a VBA routine in another Excel
file that works on the regular Excel file.
This formatting file executes VBA code on open, so all I need to do is
physically open it (no reading/writing at all). I wonder if that can
be done from R, so that I do as little as possible manually.

Thanks in advance for help!
Regards,
Sergey
--
Simplicity is the last step of art./Bruce Lee

Kniven skärpes bara mot stenen.

__
R-help@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.