OWC11 spreadsheet control problem

B

bravehao

I want put some data in the spreadsheet, so I put a OWC spreadsheet control
in my dialog. some classes used showes below
CSpreadsheet:: m_MyCSpreadsheet derived from CWnd
CRange, CWorksheet derived from COleDispatchDriver
with a button on that dialog to tirgger a event:
void Cex1Dlg::OnBnClickedButton1()
{

COleVariant covOptional(DISP_E_PARAMNOTFOUND,VT_ERROR);
CWorksheet ws(m_MyCSpreadsheet.get_ActiveSheet());
CRange range(ws.get_Range(COleVariant("A1"),COleVariant("A1")));

range.put_Value(covOptional,COleVariant("567"));

range.get_Next();
}
the last sentence throw out a exception DISP_E_MEMBERNOTFOUND to me
here is the interface for Next() in CRange.h
LPDISPATCH get_Next()
{
LPDISPATCH result;
InvokeHelper(0x60020046, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result,
NULL);
return result;
}

I am not sure it is one of the three reasons mentioned in MSDN for this
exception.
please give some help, thanks in advance!
 
A

Alvin Bruney [MVP]

boy, its been a while since I looked a c++ code but it looks like next is
not available. I've never seen that method call either. You typically access
a range through index notation, there is no next iterator that i can recall.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
B

bravehao

I switch to OWC10 spreadsheet control. It works fine.
I used OWC11 spreadsheet control in Autocad VBA form, next() do works.
MSDN said the OWC11 test didn't cover VC.
maybe it is a bug?
 

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