What do I need to do o = New Excel.Application

E

eBob.com

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()

....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top