See Also

IWorkbookSet Interface  | IWorkbookSet Members  | ReadObjects Property

Requirements

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

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages SpreadsheetGear The Performance Spreadsheet Component Company 

ReadVBA Property

SpreadsheetGear Namespace > IWorkbookSet Interface : ReadVBA Property

Gets or sets the property which specifies whether VBA Macros should be read when reading a workbook.

[Visual Basic]
Overridable Property ReadVBA As Boolean
[C#]
virtual bool ReadVBA {get; set;}
[C++]
__property virtual bool get_ReadVBA(); __property virtual void set_ReadVBA(    bool value );
[C++/CLI]
virtual property bool ReadVBA {    bool get();    void set (bool value); }

Remarks

VBA Macros are read and written by default. Set this property to false to disable reading of VBA Macros when a workbook is read.

Note that support for VBA Macros is limited to reading and writing the OLE Compound Document streams. VBA Macros cannot be copied, modified or deleted, and are not updated when worksheets or other objects are copied, modified or deleted.

Example

[C#] 

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 Basic] 

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

Requirements

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

See Also

IWorkbookSet Interface  | IWorkbookSet Members  | ReadObjects Property

 

 


See our live Excel Reporting, Excel Charting, Excel to DataGrid and Excel Calculation Samples.

Copyright © 2003-2007 SpreadsheetGear LLC. All Rights Reserved.

SpreadsheetGear and Spreadsheet Gear are trademarks of SpreadsheetGear LLC.