【发布时间】:2011-01-27 19:24:42
【问题描述】:
我只需要在当前打开的 Microsoft Excel 实例中获取当前打开的文档列表。
但我不知道 Excel 术语,不知道这些文档是否称为工作簿、工作表或窗口等。
任何想法
【问题讨论】:
标签: c# .net excel interop automation
我只需要在当前打开的 Microsoft Excel 实例中获取当前打开的文档列表。
但我不知道 Excel 术语,不知道这些文档是否称为工作簿、工作表或窗口等。
任何想法
【问题讨论】:
标签: c# .net excel interop automation
找到它(link)。
//Excel Application Object
Microsoft.Office.Interop.Excel.Application oExcelApp;
this.Activate ( );
//Get reference to Excel.Application from the ROT.
oExcelApp = ( Microsoft.Office.Interop.Excel.Application ) System.Runtime.InteropServices.Marshal.GetActiveObject ( "Excel.Application" );
//Display the name of the object.
MessageBox.Show ( oExcelApp.ActiveWorkbook.FullName );
//Release the reference.
oExcelApp = null;
【讨论】:
您正在寻找 Workbooks 属性。
【讨论】: