views:

76

answers:

2

All I need is to get the list of currently open documents in the currently open instance of Microsoft Excel.

But I don't know Excel terminology to know if these documents are called workbooks, or sheets, or windows, etc.

Any ideas

+1  A: 

You're looking for the Workbooks property.

SLaks
A: 

Found it (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;
Joan Venge
great that you found it. you can accept your own answer (the checkmark) and it removes this questions from the 'unanswered' list.
Otaku
Thanks, still have 1 day before SO allows me to do that though :O
Joan Venge