ActiveWorkbook.Protect structure:=True;//保护工作簿结构ActiveSheet.Protect DrawingObjects:=True, CONTENTS:=True, Scenarios:=True;//保护图形对象,表格内容,表格方案;ActiveSheet.EnableAutoFilter = True//设置活动工作表能自动筛选;ActiveSheet.Protect USERINTERFACEONLY:=True//设置活动工作表保护,保护用户界面放一ExcelApplication1到窗体中ExcelApplication1.ActiveWorkbook.Protectstructure:=True;ExcelApp.ActiveSheet.Protect(Password:='',DrawingObjects:=True,Contents:=True,Scenarios:=False,AllowFiltering:=True,AllowInsertingColumns:=False,AllowInsertingRows:=False,AllowInsertingHyperlinks:=False,AllowDeletingColumns:=False,AllowDeletingRows:=False,AllowSorting:=False,AllowFiltering:=False,AllowUsingPivotTables:=False);