J
Juwi_uk
In investigating slow performance in one of my projects (excel 2003) I've
found something interesting which maybe one of you may be able to comment on.
A simple worksheet_change event to change the interior color, font color and
highlight bold a cell when its value is changed.
with target.cells
..interior.color = RGB (...colour codes etc...)
..font.color = vbBlue
..font.bold = True
end with
Sometimes running the code and it returned control within a second, other
times it went away for seconds (count to five!!) before returning control.
Other times first 1 - 5 changes are fast and OK, then they slow down, then
the next batch would be OK again. Spent hours trying to analyse and improve
performance in the code
In the end I started commenting out lines one at a time until I saw an
improvement.
What do you know, commenting out the .bold line suddenly put everything back
to lightening speed and consistently too. I then messed around with italic
and underline settings and both retained a lightening fast passing of control
back to the user. Final control was to put the .bold line back; what do you
know, wait increased to 3+ seconds again. I'm sure at one time I also saw the
BOLD toolbar icon "flicker" too but not expected given I had screen updating
set to false.
Suffice it to say I'm currently showing changed fields with background
color, font colour and underline set at the moment.
Any ideas. Possibly a bug in Excel 2003 by chance?
Regards
Julian
found something interesting which maybe one of you may be able to comment on.
A simple worksheet_change event to change the interior color, font color and
highlight bold a cell when its value is changed.
with target.cells
..interior.color = RGB (...colour codes etc...)
..font.color = vbBlue
..font.bold = True
end with
Sometimes running the code and it returned control within a second, other
times it went away for seconds (count to five!!) before returning control.
Other times first 1 - 5 changes are fast and OK, then they slow down, then
the next batch would be OK again. Spent hours trying to analyse and improve
performance in the code
In the end I started commenting out lines one at a time until I saw an
improvement.
What do you know, commenting out the .bold line suddenly put everything back
to lightening speed and consistently too. I then messed around with italic
and underline settings and both retained a lightening fast passing of control
back to the user. Final control was to put the .bold line back; what do you
know, wait increased to 3+ seconds again. I'm sure at one time I also saw the
BOLD toolbar icon "flicker" too but not expected given I had screen updating
set to false.
Suffice it to say I'm currently showing changed fields with background
color, font colour and underline set at the moment.
Any ideas. Possibly a bug in Excel 2003 by chance?
Regards
Julian