Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use Visual C++ MFC 4.2.
I am developing an Excel file automation process. I need to update the value of the cells. I have succeeded in getting the old value of that cell but when I tried to update with the new value, it did not work. What cause it? I have tried both SetItem and SetValue: Worksheets sheets = book.GetSheets(); _Worksheet sheet = sheets.GetItem( COleVariant( ( short )1 ) ); LPDISPATCH lpDisp = sheet.GetRange( COleVariant( "A1" ), COleVariant( "A1" ) ); ExcelRange range; range.AttachDispatch( lpDisp ); VARIANT varRet = range.GetText(); TRACE( CString( varRet.bstrVal ) + "\n" ); lpDisp = sheet.GetRange( COleVariant( "A1" ), COleVariant( "A1" ) ); range.AttachDispatch( lpDisp ); range.SetValue( COleVariant( "XYZ" ) ); range.SetItem( COleVariant( ( short )1 ), COleVariant( "A" ), COleVariant( "ABC" ) ); range.ReleaseDispatch(); How to solve this? Thank you very much. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can i automatically generate work order numbers from work orde | Excel Discussion (Misc queries) | |||
flash object dont work in my excel work sheet | Excel Discussion (Misc queries) | |||
HOW TO MAKE A LIST OF WORK SHEET IN WORK BOOK IN EXCEL 2007 | Excel Programming | |||
If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct? | Excel Programming | |||
Programmatic schema mapping, XPath.SetValue question | Excel Programming |