Hi Graham,
AS for the
=========
.Net performs and works within an Excel workbook
=========
you mentioned, do you means using .NET to Automate the office Excel
workbook or use .NET based add-in components or something like the .net
based SmartDoc interfaces?
For .NET based Automation code, they're just a managed wrapper of the COM
interfaces All the instances are created by the underlying COM
infrastructure and be wrappered by managed code so as to make use of the
managed programming language's feature.
For those .NET based Add-in or SMARTDoc compoenents, they're hosted inside
the word/excel's unmanaged process, but be separated from the unmanaged
code. All the managed class instances or controls be controled in CLR
runtime (managed thread/ heaps....). Of course, all the Control and their
events will be fired in the same UI thread.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Graham" <en*******@newsgroups.nospam>
| Subject: Excel, .Net and threads
| Date: Mon, 19 Sep 2005 14:27:13 +1200
| Lines: 91
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_001C_01C5BD26.3A40CF60"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <OR**************@TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 222-153-55-149.jetstream.xtra.co.nz 222.153.55.149
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:125412
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have been asked by a client to produce a proof of concept of how .Net
performs and works within an Excel workbook. Everything works perfectly
with all the required events firing and data being read from the correct
cells.
| I sent this to the client and he is happy but asked some questions, and
Im not too sure on the answers (he is an old school VBA developer at heart
and doesn't know anything about .Net):
|
----------------------------------------------------------------------------
----
| The only potential issue is whether the menu is calling the same thread
of the .NET class or a new thread. I suspect it is the same thread each
time (good) and assume that your core .NET class is declared global-static
as there is no memory churn when the menus and events are running. The
problem we had with Excel 97 was that it did not support global static
classes and therefore any variable that needed to be a global variable was
not necessarily global. The use of a static function to instantiate the
class was the workaround.
|
----------------------------------------------------------------------------
----
| I believe that everything is running in the same thread and their is only
one instance of the Application and WorkBook objects.
| Can somone please confirm or deny these statements.
| Thanks
|