470,636 Members | 1,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Showing a winform in Excel is slow the first time

I have a COM shared add-in written in C# that I use in Excel.
One of the thinks that the user can do is to open some winforms.

The problem that I have is that the first time the user opens a winform it
is slow around 7 seconds and after that it takes no time.
Is there a way to speed up the process to show the winform the first time?

Thanks Torben
Apr 2 '07 #1
3 3189
Torben,

Is the showing of the form the first thing that is done when your COM
object is loaded? There are a few things that I can think of that are going
on here. The first is that the showing of the form is the first time your
COM object is referenced, and that causes the CLR to spool up, which is
going to have some overhead.

Also, if showing the form is the first operation that you are doing, is
there any initialization in the form, or in the add-in that could be
accounting for this?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Torben Laursen" <To****@newsgroups.nospamwrote in message
news:OM**************@TK2MSFTNGP05.phx.gbl...
>I have a COM shared add-in written in C# that I use in Excel.
One of the thinks that the user can do is to open some winforms.

The problem that I have is that the first time the user opens a winform it
is slow around 7 seconds and after that it takes no time.
Is there a way to speed up the process to show the winform the first time?

Thanks Torben

Apr 2 '07 #2
Nicholas,

The forms are not shown until some time after the COM is loaded.
The COM is loaded and it adds a new menu item to Excel.
The user can then use this menu item to show some forms.
The forms has some code in the constructor but very little, like setting the
active tabpage.
The forms has some components on them mostly tabpages and radiogroups

Torben

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:uH**************@TK2MSFTNGP06.phx.gbl...
Torben,

Is the showing of the form the first thing that is done when your COM
object is loaded? There are a few things that I can think of that are
going on here. The first is that the showing of the form is the first
time your COM object is referenced, and that causes the CLR to spool up,
which is going to have some overhead.

Also, if showing the form is the first operation that you are doing, is
there any initialization in the form, or in the add-in that could be
accounting for this?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Torben Laursen" <To****@newsgroups.nospamwrote in message
news:OM**************@TK2MSFTNGP05.phx.gbl...
>>I have a COM shared add-in written in C# that I use in Excel.
One of the thinks that the user can do is to open some winforms.

The problem that I have is that the first time the user opens a winform
it is slow around 7 seconds and after that it takes no time.
Is there a way to speed up the process to show the winform the first
time?

Thanks Torben


Apr 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Mark Day | last post: by
3 posts views Thread by Skc | last post: by
4 posts views Thread by Hans [DiaGraphIT] | last post: by
3 posts views Thread by | last post: by
2 posts views Thread by =?Utf-8?B?SmltIE93ZW4=?= | last post: by
1 post views Thread by Korara | last post: by
???
reply views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.