# Why can't I rescue OLE Exceptions?

**URL:** <https://www.ruby-forum.com/t/why-cant-i-rescue-ole-exceptions/136325>\
**Category:** Ruby\
**Created:** [April 30, 2008, 9:11pm UTC](https://www.ruby-forum.com/t/why-cant-i-rescue-ole-exceptions/136325 "2008-04-30T21:11:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilezparker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@nilezparker](https://www.ruby-forum.com/u/nilezparker)\
**Post date:** [April 30, 2008, 9:11pm UTC](https://www.ruby-forum.com/t/why-cant-i-rescue-ole-exceptions/136325/1 "2008-04-30T21:11:40Z")

</div>

I’ve had this problem consistently over the past year and just now I  
actually DO need to find the fix if it is AT ALL possible.

WIN32OLE raises an Exception when there are simple problems in OLE  
operations. I put in a logical rescue, and what’s odd, the rescue code  
RUNS, but the program still immediately exits no matter what I do. No  
example code necessary, try the simplest case and it should act up as  
soon as you want it to.

Is there ANY way to catch / rescue these exceptions? Why does the rescue  
code run but the code is not actually rescued?

---

<div class="post-metadata">

**Author:** ![nilezparker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@nilezparker](https://www.ruby-forum.com/u/nilezparker)\
**Post date:** [April 30, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/why-cant-i-rescue-ole-exceptions/136325/2 "2008-04-30T21:55:19Z")

</div>

On Wed, Apr 30, 2008 at 3:11 PM, Nilez P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’ve had this problem consistently over the past year and just now I  
> actually DO need to find the fix if it is AT ALL possible.

Can you post a simple example that exhibits this behavior?

–  
Avdi

Home: [http://avdi.org](http://avdi.org)  
Developer Blog: [Avdi Grimm, Code Cleric](http://avdi.org/devblog/)  
Twitter: [http://twitter.com/avdi](http://twitter.com/avdi)  
Journal: [http://avdi.livejournal.com](http://avdi.livejournal.com)

---

<div class="post-metadata">

**Author:** ![nilezparker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@nilezparker](https://www.ruby-forum.com/u/nilezparker)\
**Post date:** [May 1, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/why-cant-i-rescue-ole-exceptions/136325/3 "2008-05-01T14:59:41Z")

</div>

> > I’ve had this problem consistently over the past year and just now I  
> > actually DO need to find the fix if it is AT ALL possible.

> Can you post a simple example that exhibits this behavior?

Ok, sorry, I figured out why I was getting the odd behavior… first of  
all the error was originating in a different place than I expected. 😛

It does seem that I’ve had the aforementioned problem in the past, but  
I’m no longer running into trouble in this project, so I guess I’m  
RESOLVED. 🙂

Thanks anyway!
