Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
i can't read a cell value in excel. writing a cell value works fine with this: int cell_value=12345; { VARIANT val; val.vt = VT_I4; val.lVal = cell_value; my_manager-AutoWrap(DISPATCH_PROPERTYPUT, NULL, pXlRange, L"Value", 1, val); } but when i change the code to reading a cell value, it does not work: VARIANT k; k.vt= VT_BSTR; { VARIANT rVal; VariantInit(&rVal); my_manager-AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &rVal, pXlRange, L"value", 0); VariantCopy(&k, &rVal); VariantClear(&rVal); } BSTR mybstr=k.bstrVal; USES_CONVERSION; char* myout = W2A(mybstr); VariantClear(&k); what's wrong? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autowrap in a cell | Excel Discussion (Misc queries) | |||
Error Message: NULL IDispatch passed to Autowrap() | Excel Discussion (Misc queries) | |||
Reading a cell in VBA | New Users to Excel | |||
Reading last cell | Excel Discussion (Misc queries) | |||
Cell Reading Problem | Excel Programming |