Udostępnij za pośrednictwem


Workbook.Excel4MacroSheets Property (2007 System)

Gets a Sheets collection that represents all the Microsoft Office Excel 4.0 macro sheets in the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Excel4MacroSheets As Sheets
'Usage
Dim instance As Workbook 
Dim value As Sheets 

value = instance.Excel4MacroSheets
[BrowsableAttribute(false)]
public Sheets Excel4MacroSheets { get; }
[BrowsableAttribute(false)]
public:
property Sheets^ Excel4MacroSheets {
    Sheets^ get ();
}
public function get Excel4MacroSheets () : Sheets

Property Value

Type: Sheets
A Sheets collection that represents all the Microsoft Office Excel 4.0 macro sheets in the workbook.

Examples

The following code example iterates through every Worksheet returned by the Excel4MacroSheets property and writes the code name of each worksheet to the debug output.

This example is for a document-level customization.

Private Sub DisplayExcel4MacroSheets()
    Dim sheetsCollection As Excel.Sheets = Me.Excel4MacroSheets
    Dim i As Integer 
    For i = 1 To sheetsCollection.Count
        Dim sheet As Excel.Worksheet = _
            CType(sheetsCollection(i), Excel.Worksheet)
        System.Diagnostics.Debug.WriteLine(sheet.CodeName)
    Next i
End Sub
private void DisplayExcel4MacroSheets()
{
    Excel.Sheets sheetsCollection = this.Excel4MacroSheets;
    for (int i = 1; i < sheetsCollection.Count; i+)
    {
        Excel.Worksheet sheet = (Excel.Worksheet)sheetsCollection[i];
        System.Diagnostics.Debug.WriteLine(sheet.CodeName);
    }
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace