简体   繁体   中英

How to set value in a cell using QtActive

i am trying to put the values into an excel sheet through QtActive's QAxObject. i succeeded upto getting a work sheet. Now the win32 API to set the value for a cell is

Some_Excel_Object xx=worksheet->Cells();
xx->item[row][column] = 5;

Here i got upto the "xx". But,I don't know how to implement the above second line. I will be very thankful to the person who sheds a light on this issue.

In Qt we can do it by using following piece of code.

int rowRange = 1;
int colRange = 1;
QString values = "Test";
QAxObject * range = temp_Worksheet->querySubObject("Cells(int,int)",rowRange,colRange);
range->setProperty("Value",values);

Try this !! Good Luck !!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM