# WIN32OLE InternetExplorer SaveAs command

**URL:** <https://www.ruby-forum.com/t/win32ole-internetexplorer-saveas-command/97875>\
**Category:** Ruby\
**Created:** [January 27, 2006, 1:39am UTC](https://www.ruby-forum.com/t/win32ole-internetexplorer-saveas-command/97875 "2006-01-27T01:39:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Derek\_Haskin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9dc877/32.png) [@Derek\_Haskin](https://www.ruby-forum.com/u/Derek_Haskin)\
**Post date:** [January 27, 2006, 1:39am UTC](https://www.ruby-forum.com/t/win32ole-internetexplorer-saveas-command/97875/1 "2006-01-27T01:39:54Z")

</div>

I’ve been trying to use the WIL32OLE to call the  
InternetExplorer.ExecCommand SaveAs command.  
I’ve been able to get it to work in the interface mode  
where it displays a dialogue browser to save the file,  
but have been unable to get it to work in  
non-interface mode where you pass it the file to save  
to.

Following is an extract of the code I am using.

require ‘win32ole’  
ie = WIN32OLE.new(‘InternetExplorer.Application’)  
ie.visible = true

myUrl = “[http://www.google.com](http://www.google.com)”

ie.navigate myUrl  
sleep 1

ie.document.execCommand(“SaveAs”,false,“C:\derek\myFile.htm”)
