View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Excel does not redraw iteself

Hi Mircea,

Attaching files to this NG is frowned upon. I'm not much of a C# expert,
but I tried creating a simple C# winforms app that does what you're doing,
and I was unable to get Excel to refresh its display, too. I tried passing
Excel's handle to the Show method of the MessageBox class, and it didn't
help. You may want to try your question in a C# group to see if anyone has
had this problem when automating Excel from C#. Sorry!

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Mircea Pleteriu wrote:
Hi Jake,

Please find attached the solution with my very short windows app.
Maybe you'll get an idea about what's going wrong. The code is very
simple.

Thank you for any help,
Mircea

"Jake Marx" wrote in message
...
Hi Mircea,

Try setting the ScreenUpdating property of the Excel Application
object to True before displaying any forms or messageboxes. I'm not
sure why it would be False, as it defaults to True. But explicitly
setting it to True should fix what you're seeing.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Mircea Pleteriu wrote:
Hi,

I'm developing a class which opens the MS Excel
and extend the context menu with a new item. When the item is
clicked all it does is to popup a message box.
While the message box is displayed, it seems that Excel is locked up
and not redrawing its surface until message box control returns to
it, that is, until the message box is acknowledged.

I mention that my class is not a macro. It just accesses the Excel
from within an .NET Windows Application.

Any idea why MS Excel framwork does not get repaint while the
message box is shown?

Thanks,
Mircea