Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default C# COM in Excel: Avoid using Marshal

I often get a "Operation unavailable (Exception from HRESULT: 0x800401E3
(MK_E_UNAVAILABLE))"
Error in Excel when I try to call my UDF in a save sheet.

If I waite a few seconds the error goes away and everything works fine.

The error comes from this line of code:
App = (MSExcel.Application)Marshal.GetActiveObject("Exce l.Application");

Where App is defined as

private MSExcel.Application App;

I read that I get a reference to Excel in the OnConnection function inside
the Connect class.

But how do I use that reference inside my UDF's?

Torben








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to avoid excel pop-up in macro Francesco Magagnino Excel Discussion (Misc queries) 3 September 8th 08 11:30 AM
avoid duplication in a column in excel S.G.Pillai Excel Discussion (Misc queries) 1 July 24th 06 02:53 PM
How do I avoid duplicating names in excel? Brian,WI Excel Worksheet Functions 1 June 15th 06 01:43 AM
messages from excel -- to avoid andrei.aksenov@ Excel Programming 1 July 21st 05 01:16 PM
how to avoid duplicates in excel workbook? smart Excel Discussion (Misc queries) 1 January 10th 05 02:42 PM


All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"