GetValue() Does Not Work

L

Landon

I use Visual C++ MFC 4.2.

I need to get the value of some cells like in my code below:

LPDISPATCH lpDisp = sheet.GetRange( COleVariant( "A8" ), COleVariant(
"A10" ) );

VARIANT varRet = range.GetValue();
CString sVar( varRet.bstrVal );
if( sVar.IsEmpty() ){
}

The bug is: even if A8 has already been filled with values, it still detect
the whole range as Empty.

How to fix this?

Thank you very much.
 

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