Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel auomation Performance problem!! Need help please!

I apologize if this is not quite the correct group for this message. Also, I
sort of posted as follow up to my original questio a couple of days ago but
have since determined that this is problem I really need an answer to. ( I
will be cross posting just to have a chance for a more reponses)

I am automating Excel using C# in VS2005. I am NOT using VSTO. I need
support Excel 2000 through Excel 2007 so I am using 'late binding' via
reflection and developing with an Excel 2000 reference.

I need to perform a replace of about 100 different values, but I can be
guranteed that these values will alway be in the same place and I also have
been told that using named ranges is not likely to be allowed. So this
replace has to occur over the used area of sheet. Doing this with Excel
hidden and without user access, is extremely slow (if I use a specific named
range, it has acceptable performance). I also know that I can pull a Range
of values in an object array in C#, replace them in the array and then
repopulate the array, but this is again requires knowing the range.

It was decided to try and use an embedded macro that launch to do the
replacement so that the Replace is not occurring via the interop and COM.
Manually, opening Excel and executing the macro has performance that is more
than acceptable.

So I tried this automated with Excel hidden, and performance was extremely
poor about the same as with the replace via interop automation. A minute
plus to complete what took a second or two when launched manually. I then
made Excel visible and had the same performace problem. Finally, I ran the
application again with Excel visible and then I manully clicked Excel, giving
it focus. The macro immediately sped up and finished in a second or two.

So my questions a

- Has anyone seen this behavior for?
- Does anyone know why this is the case?
- Most, importantly is there a way around this?

The requirement is to run Excel hidden or at the very least minimized while
giving performance similar to the manual lauch of the embedded macro.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Excel auomation Performance problem!! Need help please!

I don't know what formating you are using, but one possibble method is to use
CSV format which is a text file. Excel can easily open the text file, and C
language can easily modifiy a CSV file. iff excel savve the CSV form then
you wouldn't even havve to run excel

A second method you can run excel and have it export the CSV file, then C
language modify the CSV, finally have excel read the file CSV file.

"John Mercure" wrote:

I apologize if this is not quite the correct group for this message. Also, I
sort of posted as follow up to my original questio a couple of days ago but
have since determined that this is problem I really need an answer to. ( I
will be cross posting just to have a chance for a more reponses)

I am automating Excel using C# in VS2005. I am NOT using VSTO. I need
support Excel 2000 through Excel 2007 so I am using 'late binding' via
reflection and developing with an Excel 2000 reference.

I need to perform a replace of about 100 different values, but I can be
guranteed that these values will alway be in the same place and I also have
been told that using named ranges is not likely to be allowed. So this
replace has to occur over the used area of sheet. Doing this with Excel
hidden and without user access, is extremely slow (if I use a specific named
range, it has acceptable performance). I also know that I can pull a Range
of values in an object array in C#, replace them in the array and then
repopulate the array, but this is again requires knowing the range.

It was decided to try and use an embedded macro that launch to do the
replacement so that the Replace is not occurring via the interop and COM.
Manually, opening Excel and executing the macro has performance that is more
than acceptable.

So I tried this automated with Excel hidden, and performance was extremely
poor about the same as with the replace via interop automation. A minute
plus to complete what took a second or two when launched manually. I then
made Excel visible and had the same performace problem. Finally, I ran the
application again with Excel visible and then I manully clicked Excel, giving
it focus. The macro immediately sped up and finished in a second or two.

So my questions a

- Has anyone seen this behavior for?
- Does anyone know why this is the case?
- Most, importantly is there a way around this?

The requirement is to run Excel hidden or at the very least minimized while
giving performance similar to the manual lauch of the embedded macro.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel auomation Performance problem!! Need help please!

Joel -

Thanks for the answer, however CSV is not an option. The search and replace
is for the generation of forms.

- John

"Joel" wrote:

I don't know what formating you are using, but one possibble method is to use
CSV format which is a text file. Excel can easily open the text file, and C
language can easily modifiy a CSV file. iff excel savve the CSV form then
you wouldn't even havve to run excel

A second method you can run excel and have it export the CSV file, then C
language modify the CSV, finally have excel read the file CSV file.

"John Mercure" wrote:

I apologize if this is not quite the correct group for this message. Also, I
sort of posted as follow up to my original questio a couple of days ago but
have since determined that this is problem I really need an answer to. ( I
will be cross posting just to have a chance for a more reponses)

I am automating Excel using C# in VS2005. I am NOT using VSTO. I need
support Excel 2000 through Excel 2007 so I am using 'late binding' via
reflection and developing with an Excel 2000 reference.

I need to perform a replace of about 100 different values, but I can be
guranteed that these values will alway be in the same place and I also have
been told that using named ranges is not likely to be allowed. So this
replace has to occur over the used area of sheet. Doing this with Excel
hidden and without user access, is extremely slow (if I use a specific named
range, it has acceptable performance). I also know that I can pull a Range
of values in an object array in C#, replace them in the array and then
repopulate the array, but this is again requires knowing the range.

It was decided to try and use an embedded macro that launch to do the
replacement so that the Replace is not occurring via the interop and COM.
Manually, opening Excel and executing the macro has performance that is more
than acceptable.

So I tried this automated with Excel hidden, and performance was extremely
poor about the same as with the replace via interop automation. A minute
plus to complete what took a second or two when launched manually. I then
made Excel visible and had the same performace problem. Finally, I ran the
application again with Excel visible and then I manully clicked Excel, giving
it focus. The macro immediately sped up and finished in a second or two.

So my questions a

- Has anyone seen this behavior for?
- Does anyone know why this is the case?
- Most, importantly is there a way around this?

The requirement is to run Excel hidden or at the very least minimized while
giving performance similar to the manual lauch of the embedded macro.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel auomation Performance problem!! Need help please!

Some added information here that may help others.

It appears that the performance problem I was seeing is tied to Excel 2000.
This is either because I was testing from VS2005 or some issue with Excel.
Testing against Excel 2003 and 2007 through an installed copy of my
application showed no performance issue.

I would still like to determine why Excel 2000 is giving me problems.

- John Mercure



"John Mercure" wrote:

Joel -

Thanks for the answer, however CSV is not an option. The search and replace
is for the generation of forms.

- John

"Joel" wrote:

I don't know what formating you are using, but one possibble method is to use
CSV format which is a text file. Excel can easily open the text file, and C
language can easily modifiy a CSV file. iff excel savve the CSV form then
you wouldn't even havve to run excel

A second method you can run excel and have it export the CSV file, then C
language modify the CSV, finally have excel read the file CSV file.

"John Mercure" wrote:

I apologize if this is not quite the correct group for this message. Also, I
sort of posted as follow up to my original questio a couple of days ago but
have since determined that this is problem I really need an answer to. ( I
will be cross posting just to have a chance for a more reponses)

I am automating Excel using C# in VS2005. I am NOT using VSTO. I need
support Excel 2000 through Excel 2007 so I am using 'late binding' via
reflection and developing with an Excel 2000 reference.

I need to perform a replace of about 100 different values, but I can be
guranteed that these values will alway be in the same place and I also have
been told that using named ranges is not likely to be allowed. So this
replace has to occur over the used area of sheet. Doing this with Excel
hidden and without user access, is extremely slow (if I use a specific named
range, it has acceptable performance). I also know that I can pull a Range
of values in an object array in C#, replace them in the array and then
repopulate the array, but this is again requires knowing the range.

It was decided to try and use an embedded macro that launch to do the
replacement so that the Replace is not occurring via the interop and COM.
Manually, opening Excel and executing the macro has performance that is more
than acceptable.

So I tried this automated with Excel hidden, and performance was extremely
poor about the same as with the replace via interop automation. A minute
plus to complete what took a second or two when launched manually. I then
made Excel visible and had the same performace problem. Finally, I ran the
application again with Excel visible and then I manully clicked Excel, giving
it focus. The macro immediately sped up and finished in a second or two.

So my questions a

- Has anyone seen this behavior for?
- Does anyone know why this is the case?
- Most, importantly is there a way around this?

The requirement is to run Excel hidden or at the very least minimized while
giving performance similar to the manual lauch of the embedded macro.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with VBA execution performance problem SaeOngJeeMa Excel Programming 3 March 18th 07 12:27 AM
Excel performance problem (Excel11.xlb file) Alain79[_3_] Excel Programming 3 April 24th 06 06:50 PM
Performance problem with VB Macro in Excell XP RayOTown Excel Programming 1 December 6th 04 05:57 PM
Excel Add-In performance problem jbicik Excel Programming 0 November 17th 04 12:41 AM
problem with performance of excel macro, pls help lee777[_2_] Excel Programming 1 June 18th 04 11:47 AM


All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"