_Application.ThisWorkbook Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a Workbook object that represents the workbook where the current macro code is running.
public:
property Microsoft::Office::Interop::Excel::Workbook ^ ThisWorkbook { Microsoft::Office::Interop::Excel::Workbook ^ get(); };
public Microsoft.Office.Interop.Excel.Workbook ThisWorkbook { get; }
Public ReadOnly Property ThisWorkbook As Workbook
Property Value
Remarks
Use this property to refer to the workbook that contains your macro code. ThisWorkbook is the only way to refer to an add-in workbook from inside the add-in itself. The ActiveWorkbook property doesn't return the add-in workbook; it returns the workbook that's calling the add-in. The Workbooks property may fail, because the workbook name probably changed when you created the add-in. ThisWorkbook always returns the workbook in which the code is running.
This property can be used only from inside Excel. You cannot use it to access a workbook from any other application.
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기