Microsoft로 로그인
로그인하거나 계정을 만듭니다.
안녕하세요.
다른 계정을 선택합니다.
계정이 여러 개 있음
로그인할 계정을 선택합니다.
영어
죄송합니다. 이 문서는 귀하의 언어로 사용할 수 없습니다.

Symptoms

When Microsoft Excel loads an Automation add-in during cell edit mode, Excel fails. This problem only occurs with Automation add-ins that have been Demand Loaded into Excel.

Cause

This problem can occur when an add-in loads if the add-in displays a form or dialog box, or if the add-in makes an Automation request to Excel that tries to change the state of Excel. The following list includes samples of Automation requests that may cause Excel to fail when it is called while an Automation add-in loads during cell edit mode:

  • Programmatically change the current selection. For example:

    Application.ActiveSheet.Range("A1").Select
  • Call a property or method of an item in the Windows collection. For example:

    Application.ActiveWindow.Zoom = 200
  • Change an Excel setting such as the calculation mode. For example:

    Application.CalculationMode = xlManual

All of these items are examples of code attempts to change the Excel environment, a workbook, or a worksheet; these types of actions are not permitted while in edit mode.

Resolution

Do not try the above-mentioned actions while your add-in loads. Add-in methods that are called during the load include the Initialize method and, if your Automation add-in implements the IDTExtensibility2 interface, the OnConnection and OnStartupComplete methods as well.

Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

More Information

Steps to Reproduce Problem

  1. Start a new ActiveX DLL project in Visual Basic.

  2. From the Project menu, click Project1 Properties. Change the Project Name to TestAddIn, and then click OK.

  3. Add the following code to the code module for Class1:

    Private Sub Class_Initialize()
    MsgBox "Class_Initialize"
    End Sub
  4. Build TestAddIn.dll.

  5. In Excel, start a new workbook.

  6. In Microsoft Office Excel 2003 or in Microsoft Excel 2002, follow these steps:

    1. On the Tools menu, point to Add-Ins, and then click Automation.

    2. In the list, click TestAddIn.Class1, and then click OK.

    3. In the Add-Ins dialog box, click OK.

    In Microsoft Office Excel 2007, follow these steps:

    1. Click the Microsoft Office Button, and then click
      Excel Options.

    2. Click the Add-Ins tab.

    3. In the Manage list, click Excel Add-ins, and then click Go.

    4. In the Add-Ins dialog box, click
      Automation.

    5. In the list, click TestAddin.Class1, and then click OK.

    6. Click OK.

  7. Type =a in any cell. A message box with the text "Class_Initialize" appears.

  8. Click OK to dismiss the message box. After a few seconds, Excel fails.

References

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

291392 INFO: Excel COM Add-ins and Automation Add-ins

도움이 더 필요하세요?

더 많은 옵션을 원하세요?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

이 정보가 유용한가요?

사용 경험에 어떠한 영향을 주었나요?
제출을 누르면 피드백이 Microsoft 제품과 서비스를 개선하는 데 사용됩니다. IT 관리자는 이 데이터를 수집할 수 있습니다. 개인정보처리방침

의견 주셔서 감사합니다!

×