View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Mircea Pleteriu Mircea Pleteriu is offline
external usenet poster
 
Posts: 28
Default Excel does not redraw iteself

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