Sometime OWC9 is slow

P

Patrice Dargenton

Hello, I am trying to fix this bug : sometime (for very few computers), OWC9
is very slow for writing value in cells. I noticed that if a background task
is running, for example compressing a big file, the bug disappears totally !
Then I was wondering if this bug has something to do with Garbage collector
: If Garbage collector does not have time to run, then the bug disappears :
does anybody have a solution or a strategy to find one ? Can I disable
Garbage collector for a while ?
Is there a framework setting that I can tune ? A regional setting ?
Thanks.

Sample speed test : less than 1 second in normal case, and 10 seconds with
the bug :

oXL.EnableUndo = False
oXL.EnableEvents = False
oXL.ScreenUpdating = False
oXL.ActiveSheet.Protection.Enabled = False

Dim i%, j%
For i = 1 To 10
For j = 1 To 5
oXL.Cells(i, j) = (i + j).ToString
Next
Next

oXL.EnableUndo = True
oXL.EnableEvents = True
oXL.ScreenUpdating = True
oXL.ActiveSheet.Protection.Enabled = True
 
A

Alvin Bruney [MVP]

Then I was wondering if this bug has something to do with Garbage
collector

The two are unrelated. OWC is not managed code so it isn't influenced by the
garbage collector. This is probably machine specific. You can see if the
issue occurs on another computer. Or it is Operating System specific. You
can see if this issue occurs on another Operating System.

One helpful thing to do is to start timing the method calls so you have some
idea EXACTLY which method is slow. For instance, if it is a pivot table
query, it just may be the network.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
P

Patrice Dargenton

One helpful thing to do is to start timing the method calls so you have
some idea EXACTLY which method is slow. For instance, if it is a pivot
table query, it just may be the network.

I did it : oXL.Cells(i, j) = xxx is the only line involved in this bug
This is probably machine specific.

Maybe, but I didn't find the cause of the bug. A background task makes the
bug disappear, but this is not a solution.
Or it is Operating System specific

No : I think the bug doesn't depend on Operating System : I found this bug
on Windows XP Familly and Windows 2000 Pro.

I tried to disassemble Interop.OWC using Reflector, but I didn't find
anything abnormal.
-------------------------------------------------------
Patrice Dargenton
(e-mail address removed)
http://patrice.dargenton.free.fr/index.html
-------------------------------------------------------

Alvin Bruney said:
Then I was wondering if this bug has something to do with Garbage
collector

The two are unrelated. OWC is not managed code so it isn't influenced by
the garbage collector. This is probably machine specific. You can see if
the issue occurs on another computer. Or it is Operating System specific.
You can see if this issue occurs on another Operating System.

One helpful thing to do is to start timing the method calls so you have
some idea EXACTLY which method is slow. For instance, if it is a pivot
table query, it just may be the network.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
P

Patrice Dargenton

Note : This bug is frequent for 1 Go Ram PCs, and rare for 512 Ko Ram PCs.
-------------------------------------------------------
Patrice Dargenton
(e-mail address removed)
http://patrice.dargenton.free.fr/index.html
-------------------------------------------------------


Patrice Dargenton said:
One helpful thing to do is to start timing the method calls so you have
some idea EXACTLY which method is slow. For instance, if it is a pivot
table query, it just may be the network.

I did it : oXL.Cells(i, j) = xxx is the only line involved in this bug
This is probably machine specific.

Maybe, but I didn't find the cause of the bug. A background task makes the
bug disappear, but this is not a solution.
Or it is Operating System specific

No : I think the bug doesn't depend on Operating System : I found this bug
on Windows XP Familly and Windows 2000 Pro.

I tried to disassemble Interop.OWC using Reflector, but I didn't find
anything abnormal.
-------------------------------------------------------
Patrice Dargenton
(e-mail address removed)
http://patrice.dargenton.free.fr/index.html
-------------------------------------------------------

Alvin Bruney said:
Then I was wondering if this bug has something to do with Garbage
collector

The two are unrelated. OWC is not managed code so it isn't influenced by
the garbage collector. This is probably machine specific. You can see if
the issue occurs on another computer. Or it is Operating System specific.
You can see if this issue occurs on another Operating System.

One helpful thing to do is to start timing the method calls so you have
some idea EXACTLY which method is slow. For instance, if it is a pivot
table query, it just may be the network.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Patrice Dargenton said:
Hello, I am trying to fix this bug : sometime (for very few computers),
OWC9
is very slow for writing value in cells. I noticed that if a background
task
is running, for example compressing a big file, the bug disappears
totally !
Then I was wondering if this bug has something to do with Garbage
collector
: If Garbage collector does not have time to run, then the bug
disappears :
does anybody have a solution or a strategy to find one ? Can I disable
Garbage collector for a while ?
Is there a framework setting that I can tune ? A regional setting ?
Thanks.

Sample speed test : less than 1 second in normal case, and 10 seconds
with
the bug :

oXL.EnableUndo = False
oXL.EnableEvents = False
oXL.ScreenUpdating = False
oXL.ActiveSheet.Protection.Enabled = False

Dim i%, j%
For i = 1 To 10
For j = 1 To 5
oXL.Cells(i, j) = (i + j).ToString
Next
Next

oXL.EnableUndo = True
oXL.EnableEvents = True
oXL.ScreenUpdating = True
oXL.ActiveSheet.Protection.Enabled = True
 
P

Patrice Dargenton

Palliative solution found :
Me.oXL.ActiveSheet.Range(sRange).ParseText(sDatas, vbTab)

Dim sb As New System.Text.StringBuilder
For i = 1 To 10
For j = 1 To 5
sb.Append((i + j).ToString).Append(vbTab)
Next
sb.Append(vbLf)
Next
Me.oXL.ActiveSheet.Range("A1").ParseText(sb.ToString, vbTab)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top