
Signature
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
But I have counted the time of 30 seconds before calling
xl = new Microsoft.Office.Interop.Excel.ApplicationClass();
That means Excel.exe is still not running.
I am wondering whether for the time of 30 seconds the CLR is JIT compiling
RCW for the Excel automation class or is doing something else, and how can I
redure this time
There are
> ways to do it without starting word which includes basically parsing the
> file. => Not clear !!!
> I think the time spent is actually in automating excel; ie getting it to
> start. When you run the application, go to task manager and see if there is
[quoted text clipped - 39 lines]
> >
> > Run
Bram - 17 Jul 2007 12:59 GMT
Hi Alexander,
The .NET runtime uses a Just In Time (JIT) compiler. Basically this
means that all assemblies will be loaded on the fly whenever they are
first actually used. In your case, .NET detects that you're about to
use Microsoft.Office.Interop.Excel, so it loads the Assembly. Even if
it's not actually *starting* excel, it's not inconceivable that a
large part of the runtimes used by Excel also need to be loaded, which
can take quite some time.
Are you performing the action in a batch process? In that case, it
might be a good idea to hoist some of the batch logic into your .NET
application in such a way that instead of:
MyExcelMacroAttacher.exe c:\Excel\Sheet1.xls
MyExcelMacroAttacher.exe c:\Excel\Sheet2.xls
MyExcelMacroAttacher.exe c:\Excel\Sheet3.xls
MyExcelMacroAttacher.exe c:\Excel\Sheet4.xls
you can run:
MyExcelMacroAttacher.exe c:\Excel\
You'll still have to load the runtimes (there's no changing that, if
you want to use Excel Interop), but you'll only have to do it once.
Hope it helps!
Regards
Bram
On Jul 11, 12:30 pm, Alexander Kolev
<AlexanderKo...@discussions.microsoft.com> wrote:
> But I have counted the time of 30 seconds before calling
>
[quoted text clipped - 63 lines]
>
> > > Run