Separate Code Files for each Excel Worksheet

With Visual Studio Tools for Office 2005 (VSTO), you can have custom code for each worksheet in your Microsoft Excel solution. Excel projects contain a separate code-behind class file for each worksheet plus another class file for the entire workbook. Code that is specific to a worksheet, such as code that responds to a control on a worksheet, should be placed in the sheet class. Code that affects the workbook generally, such as the workbook Open event, the BeforeClose event, and actions pane code, should be placed in the workbook class. Under these class files are hidden files containing generated code that you should not modify because your changes will be lost when the code regenerates.