473,511 Members | 17,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3351
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
5562
by: Mark Day | last post by:
Hi All, I am using Access 2000 to generate over 40 Excel charts and pivot tables using early binding to the Excel 9.0 object library. I am finding that if I show the Excel object while processing...
11
4025
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
3
1973
by: Skc | last post by:
My client's project consists of about 6 files maintenance programs that uses WinForm and grid for updates with lookup finders for each file. There is also a User file and security. There are...
4
33435
by: Hans [DiaGraphIT] | last post by:
Hi! I want to export a dataset to an excel file. I found following code on the net... ( http://www.codeproject.com/csharp/Export.asp ) Excel.ApplicationClass excel = new ApplicationClass();...
3
3725
by: | last post by:
Hello, I have a routine in my Windows application that exports the contents of a datagrid to Excel. It is modeled closely after the HowTo example on MSDN: http://tinyurl.com/5g2jm. Depending...
2
1906
by: ScardyBob | last post by:
Hello, I am having trouble importing data from an Excel Worksheet. When I try to import the data, everything works except certain columns that contain dates, where it replaces the date with a...
2
2456
by: awu | last post by:
All: I have a query that has 5 fields and around 15500 records. I need to save it to a excel file that has two sheets. First sheet saves all the 15500 records. Second sheet saves around 7500...
1
2929
by: ssaini | last post by:
Hi, I am consuming a java web service in .NET C# smart client, which is based upon Microsoft's SCSF application block.The SCSF is a wrapper over WinForms. When I make a call to any of the Java...
2
5545
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi John, Hopefully this post will find its way back to you - or perhaps be answered by someone else. As I mentioned in my last post on the earlier portion of this thread, changing the...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.