View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Fredrik Wahlgren Fredrik Wahlgren is offline
external usenet poster
 
Posts: 339
Default Excel does not redraw iteself

I would like to test this on my PC. Can you zip the project and send it to
me. My email address is


/Fredrik

"Mircea Pleteriu" wrote in message
...
Here it is:

// Create instance of Excel application

this.excelApp = new Excel.ApplicationClass();

this.workbooks = this.excelApp.Workbooks;

// Open workbook with file

this.fileWorkbook = workbooks.Open(path,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing);



// Get context menu

Office.CommandBarControls contextMenu =
this.excelApp.CommandBars["Cell"].Controls;

// Add item to menu

this.item =

(Office.CommandBarButton)contextMenu.Add(Office.Ms oControlType.msoControlBut
ton, Type.Missing, Type.Missing, Type.Missing, true);

this.item.Caption = "MyNewItem";

this.item.BeginGroup = true;

this.item.Click += new

Microsoft.Office.Core._CommandBarButtonEvents_Clic kEventHandler(ClickHandler
Method);




// Make instance of Excel application visible

this.excelApp.Visible = true;

Here is the ClickHandlerMethod's code

// Switch alerts off
this.excelApp.DisplayAlerts = false;

System.Windows.Forms.MessageBox.Show("Excel does not repaint!");



"Fredrik Wahlgren" wrote in

message
...

"Mircea Pleteriu" wrote in message
...
Please find attached a screen shot.


I recognize this problem. I need to think before I can reply. BTW since

your
code apparently is very small, can you send it as well. All I want is

the
minimum amount of code that shows this problem.

/Fredrik