C# 클래스 Smrf.AppLib.ExcelActiveWorksheetRestorer

Saves and restores the active worksheet of an Excel workbook.
Writing to a worksheet that isn't active causes problems with the selection in Excel. To avoid such problems, use this class to activate the worksheet that needs to be written to and then restore the original active worksheet when you're done writing. The activations are done with Excel's screen updating turned off, so they are not visible to the user.

Call ActivateWorksheet to activate the worksheet that needs to be written to. Call Restore when you're done writing.

If you activate a worksheet by other means but still want to use this class to save and restore the original active worksheet, call to save the active worksheet state and call Restore when you're done writing.

상속: Object
파일 보기 프로젝트 열기: 2014-sed-team3/term-project 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
m_oWorkbook Workbook

공개 메소드들

메소드 설명
ActivateWorksheet ( Worksheet worksheet ) : ExcelActiveWorksheetState
ExcelActiveWorksheetRestorer ( Microsoft workbook ) : System

Initializes a new instance of the class.

GetActiveWorksheetState ( ) : ExcelActiveWorksheetState
Restore ( ExcelActiveWorksheetState excelActiveWorksheetState ) : void

비공개 메소드들

메소드 설명
AssertValid ( ) : void

메소드 상세

ActivateWorksheet() 공개 메소드

public ActivateWorksheet ( Worksheet worksheet ) : ExcelActiveWorksheetState
worksheet Worksheet
리턴 ExcelActiveWorksheetState

ExcelActiveWorksheetRestorer() 공개 메소드

Initializes a new instance of the class.
public ExcelActiveWorksheetRestorer ( Microsoft workbook ) : System
workbook Microsoft /// Workbook containing the worksheet that will be activated. ///
리턴 System

GetActiveWorksheetState() 공개 메소드

public GetActiveWorksheetState ( ) : ExcelActiveWorksheetState
리턴 ExcelActiveWorksheetState

Restore() 공개 메소드

public Restore ( ExcelActiveWorksheetState excelActiveWorksheetState ) : void
excelActiveWorksheetState ExcelActiveWorksheetState
리턴 void

프로퍼티 상세

m_oWorkbook 보호되어 있는 프로퍼티

protected Workbook m_oWorkbook
리턴 Workbook