interface not supported excel COM

G

Guest

Hi,

I hope this is correct forum for this, this might possibly an academic type
question.

I am trying to copy a dataset to an excel spreadsheet for my asp.net
application.
(written VB).

I have tried lots of sample code examples but everyone gets stuck at the
point where I try to manipulate a cell.
snippet follows:

Dim oSheet As Excel.Worksheet (note: not all declarations provided)

oSheet.Cells(1, 1).Interior.Color = m_Report.m_heading_color
oSheet.Cells(1, 1).Value = "PP"
oSheet.Cells(2, 1).CopyFromRecordset(drdata)

all of these statements cause a "no such interface supported" error.
I don't have intellisense appearing after the cells.

Does anyone know what the problem might be ?

thanks

Chris
 
I

Indie Pop

You need to add a reference to Excel.

Right click References in the Solution tree.

Then find Microsoft Excel under the COM tab.
 
G

Guest

Hi Indie Pop,

I have already reference the excel object and provided import statements.
VS2003 automatically turned it into an interop.excel.dll.

I found out the problem my syntax was incorrect.

Now I have another problem: the message when I run that line of code is:

"Exception from HRESULT: 0x800A03EC."
source = "Interop.Excel"

any ideas?

thanks
Chris
 

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