This project has moved. For the latest updates, please go here.
' taken from Tutorial07.vbproj
'
' The static class LateBindingApi.Core.Invoker is the low level interface from 
' NetOffice to access a COM Server.
' This example shows you an example how to use it. ' ' See reference chapter4 in technical documentation for further info. ' Private Sub Tutorial07Main() 'Initialize Api COMObject Support LateBindingApi.Core.Factory.Initialize() ' start application Dim application As New Excel.Application() application.DisplayAlerts = False ' create new Workbook Dim book As Excel.Workbook = application.Workbooks.Add() Dim sheet As Excel.Worksheet = application.Workbooks(1).Worksheets(1) Dim sampleRange As Excel.Range = sheet.Cells(1, 1) ' we set the COMVariant ColorIndex from Font of ouer sample range with
' the invoker class
Invoker.PropertySet(sampleRange.Font, "ColorIndex", 1) ' creates a native unmanaged ComProxy with the invoker Dim comProxy As Object = Invoker.PropertyGet(application, "Workbooks") Marshal.ReleaseComObject(comProxy) application.Quit() application.Dispose() MessageBox.Show(Me, "Done!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information) End Sub

Last edited Jan 5, 2012 at 11:24 AM by SebastianDotNet, version 6

Comments

No comments yet.