# Launch MS Excel from within Ruby

**URL:** <https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503>\
**Category:** Ruby API\
**Created:** [March 4, 2016, 7:09pm UTC](https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503 "2016-03-04T19:09:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewBirckbichler](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/matthewbirckbichler/32/19770_2.png) [@matthewBirckbichler](https://forums.sketchup.com/u/matthewBirckbichler)\
**Post date:** [March 4, 2016, 7:09pm UTC](https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503/1 "2016-03-04T19:09:38Z")

</div>

Is it possible to launch an MS Excel file from within Ruby Script?

---

<div class="post-metadata">

**Author:** ![slbaumgartner](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/slbaumgartner/32/7302_2.png) [@slbaumgartner](https://forums.sketchup.com/u/slbaumgartner)\
**Post date:** [March 4, 2016, 7:20pm UTC](https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503/2 "2016-03-04T19:20:28Z")

</div>

Ruby has multiple methods to run subprocesses in many ways - for example backtick (`), %x, system, IO.popen, exec, … They differ in how you have to manage the subprocess and how you get return values (if any). Be advised, though, that the way you phrase the command you give to these can determine whether Ruby (and hence all of SketchUp) will freeze until the command exits.

---

<div class="post-metadata">

**Author:** ![jim\_foltz](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jim_foltz/32/74787_2.png) [@jim\_foltz](https://forums.sketchup.com/u/jim_foltz)\
**Post date:** [March 4, 2016, 7:34pm UTC](https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503/3 "2016-03-04T19:34:49Z")

</div>

In addition to the ruby meyhods, it can also be done from the sketchup API using the method: UI.openURL()

Which I believe is non-blocking.

---

<div class="post-metadata">

**Author:** ![john\_drivenupthewall](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@john\_drivenupthewall](https://forums.sketchup.com/u/john_drivenupthewall)\
**Post date:** [March 4, 2016, 7:37pm UTC](https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503/4 "2016-03-04T19:37:59Z")

</div>

```ruby
UI.openURL('file:///' + path_to_file)

```

this is the cross platform form, for opening in default application…

john

---

<div class="post-metadata">

**Author:** ![slbaumgartner](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/slbaumgartner/32/7302_2.png) [@slbaumgartner](https://forums.sketchup.com/u/slbaumgartner)\
**Post date:** [March 4, 2016, 7:55pm UTC](https://forums.sketchup.com/t/launch-ms-excel-from-within-ruby/21503/5 "2016-03-04T19:55:03Z")

</div>

They are overdue to update the API docs on this! It says it opens the URL in your default browser, not using the default app for the document type.
