Udostępnij za pośrednictwem


How to: Check Spelling in Worksheets

You can programmatically check the spelling of words in a worksheet. The Spelling dialog box automatically appears if there are any incorrectly spelled words in the worksheet.

Applies to: The information in this topic applies to document-level projects and application-level projects for Excel 2007 and Excel 2010. For more information, see Features Available by Office Application and Project Type.

To check spelling in a worksheet in a document-level customization

  • Call the CheckSpelling method of the worksheet.

    Globals.Sheet1.CheckSpelling()
    
    Globals.Sheet1.CheckSpelling(missing, missing, missing, missing);
    

To check spelling in a worksheet in an application-level add-in

  • Call the CheckSpelling method of the active worksheet.

    CType(Application.ActiveSheet, Excel.Worksheet).CheckSpelling()
    
    ((Excel.Worksheet)Application.ActiveSheet).CheckSpelling
        (missing, missing, missing, missing);
    

See Also

Tasks

How to: Run Excel Calculations Programmatically

Concepts

Working with Worksheets

NamedRange Control

Optional Parameters in Office Solutions