BUG: ??? ?? ???? ??? ??? ???? ????? Excel ?? ????? CommandButton

?????? ????????? ?????? ?????????
???? ???????: 823988 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

???? ???? ???? ??????? ?????? ??? ??????? ?????? ??? Office Excel 2003. ?????? ???? ????? ?? ??? "?????" ???? ???? MSForms CommandButton ????? ?????? ?? ???? ????? ???????? ??? ???? ???. ??? ????? ??? ???? ?????? ?? ????? ?? ??? ????? ???? ?? ?? ????? ??? ??? ???????.

?????

???? Microsoft ?? ??? ??? ?? Office Excel 2003.

????

??? ??? ???????? ???? ?? ?? CommandButton ?? ????? ??????? ??? ??? ???? ???????. ?????? ???? ????? ???????:
  • ?? ?????? ????? TakeFocusOnClickCommandButton ??? false.

    - ?? -
  • ????? ????? ??????? ???? ????? ??????? ??? ??? ??????? ?????? ?? CommandButton.

???? ??????

??????? ?????? ??? ??? ??????? ?????? ???? ????? ???????:
  • ?? ?????? ??????? TakeFocusOnClick ????? ?????? CommandButton ??? false: ?????
    protected void ThisWorkbook_Open()
    {
    	//Get a reference to the first worksheet.
    	ws = (Excel.Worksheet)(ThisWorkbook.Worksheets[1]);
    
    	//Set up the Click event handler for CommandButton1.
    	cb = (MSForms.CommandButton)(this.FindControl("CommandButton1"));
    	cb.Click+= new MSForms.CommandButtonEvents_ClickEventHandler(cbClick);
    
    	cb.TakeFocusOnClick = false;
    }
    


    - ?? -
  • ??????? ??????? ????? ???? ????? ??????? ??????? ??? ????? ??????? ?? CommandButton:
    private void cbClick()
    { 
    	ThisApplication.Selection.GetType().InvokeMember("Select",
    		System.Reflection.BindingFlags.Public | 
    		System.Reflection.BindingFlags.InvokeMethod | 
    		System.Reflection.BindingFlags.Instance,
    		null,
    		ThisApplication.Selection,
    		null);
    	
    	ws.ListObjects[1].ListRows[1].Delete();
    }
    

??????? ????

????? ????? ????? ?? ????

  1. ??? ????? Microsoft Visual Studio .NET 2003.
  2. ?? ??????? ???? ??? ??? ???? ?? ???? ??? ???????.
  3. ?? ??????? ????? ??????? "? ?? ?????? ??????? ???? Microsoft Office ?? ???? ??? Visual C# ????????. ??? ???? Excel ?? ??????? ???? ?? ???? ??? ?????.
  4. ???? ??? "?????" ?? Microsoft Office Project ?????.
  5. ???? ??????? F5 ?????? ??????? ?? ??? ?????? ?? Excel.
  6. ????? ?????? ??? ???:
    1. ??? ?????? A1.
    2. ??? ??????? ?????? ? ??? ??? ????? ?? ???? ??? ????? ?????. ???? ???? ?????? ????? ?????. ???? ??? ?????.
    3. ????? ?? ?? ??? ????? A2 ? A3 ? A4 (A2: A4).
    4. ?? ??????? ???? ??? ??? ????? ??????? ?? ???? ??? ???? ????? ??????.
    5. ???? ???? ???? CommandButton ?? ???? ?????. ????? ????????? ?? CommandButton1.
    6. ??? ?????? ?? ?? ?????? Excel.
  7. ?? ?????? ????????? ???????? ??????? ??? ?????? ??????? ????????? ???????? Thisworkbook.cs:
    private MSForms.CommandButton cb;
    private Excel.Worksheet ws;
    
    protected void ThisWorkbook_Open()
    {
    	//Get a reference to the first worksheet.
    	ws = (Excel.Worksheet)(ThisWorkbook.Worksheets[1]);
    
    	//Set up the Click event handler for CommandButton1.
    	cb = (MSForms.CommandButton)(this.FindControl("CommandButton1"));
    	cb.Click+= new MSForms.CommandButtonEvents_ClickEventHandler(cbClick);
    }
    
    private void cbClick()
    {
    	try
    	{
    		//Delete the first row in the list object.
    		ws.ListObjects[1].ListRows[1].Delete();
    	}
    	catch (Exception ex)
    	{
    		System.Diagnostics.Debug.WriteLine(ex.Message);
    		MessageBox.Show(ex.Message);
    	}
    }
    
  8. ???? ??????? F5 ?????? ??????? ?????.
  9. ???? ??? CommandButton1.

    ??????? ?? ?????? ??????? ??? ??? ???? ?? ???????. ???? ????? ????? ???????
    ??????? ?? HRESULT: 0x800A03EC

???????

???? ???????: 823988 - ????? ??? ??????: 25/?? ?????/1427 - ??????: 2.3
????? ???
  • Microsoft Office Excel 2003
  • Microsoft Visual Studio Tools for the Microsoft Office System version 2003
????? ??????: 
kbmt kbbug kbautomation kbnofix KB823988 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????823988

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com