Hi,
I'll speculate a bit on what you are seeing:
Your function is marked as IsThreadSafe=true, so might execute on a
thread that is not the main Excel calculation thread, where the main
Excel STA COM apartment also lives.
You can investigate what thread is running your function, and compare
with functions what are not marked IsThreadSafe=true.
So when you call ExcelDnaUtil.Application from a different thread,
Excel-DNA will retrieve the Application object from Excel, and COM
will do the cross-thread marshalling to give you a COM proxy that you
can use from your thread (the secondary calculation thread). Now,
still in your function, you essentially call back to the Application
(presumable the default property will get called, and so on). This
call fails to be marshalled across to the main thread, since the COM
processing on the main thread is mostly suspended during
recalculation. Hence you get the exception you report, stating that
the Excel object model is not available.
So, calling the COM automation model from a user-defined function is
unsupported, and certainly makes the function not thread-safe. Don't
mark such a function as IsThreadSafe=true. I superstitiously believe
marking such functions with IsMacroType=true is a good idea.
-Govert