![]() |
What do I need to do o = New Excel.Application
I use the code below in a VB.Net application to create an Excel spreadsheet.
(Is this what is called "interop"?) My development machine has Office XP Pro. Now I am moving development of this application to a new machine and have to minimize my licensing costs. Do I need a "Pro" level of office to do this? Or will any level of Excel, Std., Pro., whatever, provide the support this application requires? I wouldn't mind switching to OpenOffice, but I've been unable to determine if it provides a similar API. Thanks, Bob Dim objApp As Excel.Application Dim objBook As Excel._Workbook Dim objBooks As Excel.Workbooks Dim objSheets As Excel.Sheets Dim objSheet As Excel._Worksheet .... ' Instantiate Excel and start a new workbook. objApp = New Excel.Application ' This works 'objApp = CreateObject("Excel.Application") ' This does NOT work objBooks = objApp.Workbooks objBook = objBooks.Add objSheets = objBook.Worksheets objSheet = DirectCast(objBook.ActiveSheet, Excel._Worksheet) 'use "top" alignment for all cells objSheet.Cells.Select() .... |
All times are GMT +1. The time now is 10:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com