SpreadsheetGear 2010
ReadObjects Property
See Also  Example Send Feedback
SpreadsheetGear Namespace > IWorkbookSet Interface : ReadObjects Property

Gets or sets the property which specifies whether charts, pictures and drawing objects should be read when reading a workbook.

Syntax

Visual Basic (Declaration) 
Property ReadObjects As Boolean
C# 
bool ReadObjects {get; set;}

Example

C#Copy Code
using System;
using SpreadsheetGear;
 
namespace ConsoleApplication
{
    /// <summary>
    /// Demonstrate a custom function which sums the range of cells or values passed to it.
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            // Create a new empty workbook.
            IWorkbookSet workbookSet = Factory.GetWorkbookSet();
 
            // Set to not read VBA or Objects (shapes).
            workbookSet.ReadVBA = false;
            workbookSet.ReadObjects = false;
 
            // Read MyWorkbook.xls without VBA or objects.
            IWorkbook workbook = workbookSet.Workbooks.Open("MyWorkbook.xls");
        }
    }
}
Visual BasicCopy Code
Imports System
Imports SpreadsheetGear
 
 
Namespace ConsoleApplication
    _
    ' Demonstrate reading a workbook without VBA or objects (shapes).
    Class Program
 
        Public Overloads Shared Sub Main()
            ' Create a new empty workbook.
            Dim workbookSet As IWorkbookSet = Factory.GetWorkbookSet()
 
            ' Set to not read VBA or Objects (shapes).
            workbookSet.ReadVBA = False
            workbookSet.ReadObjects = False
 
            ' Read MyWorkbook.xls without VBA or objects.
            Dim workbook As IWorkbook = workbookSet.Workbooks.Open("MyWorkbook.xls")
        End Sub 'Main
    End Class 'Program
End Namespace 'ConsoleApplication

Remarks

Charts, pictures and drawing objects are read and written by default. Set this property to false to disable reading of charts, pictures and drawing objects when a workbook is read.

Note that setting ReadDrawingObjects to false will not disable reading of chart sheets.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2003-2010 SpreadsheetGear LLC. All Rights Reserved.Help Powered by Innovasys   
SpreadsheetGear is a registered trademark of SpreadsheetGear LLC.
Microsoft, Microsoft Excel and Visual Studio are trademarks or registered trademarks of Microsoft Corporation.