Hi all,
i am finding this run time error when i am trying to
enter one Tables data to an excel worksheet through
coding.

code -----

  CustTable     custTable;
   int           rowCounter;



COM excel;
COM workBooks, workBook ;
COM workSheets, workSheet;
COM cell;
COMVariant variant;



excel = new COM("Excel.Application");



excel.visible(true);



workBooks = excel.workBooks() ; workBook = workBooks.add() ; workSheets = workBook.workSheets() ; workSheet = workSheets.item(1) ;


variant = new COMvariant(COMVariantInOut::OUT, COMVariantType::VT_BSTR) ;


rowCounter = 1;




while select * from custtable
{
variant.bStr(custTable.AccountNum) ;
cell = workSheet.range("A" +
int2str(rowCounter)); cell.value(variant);




       variant.bStr(custTable.Name) ;
       cell       = workSheet.range("B"+
int2str(rowCounter));
       cell.value(variant);



       rowCounter++;
   }


The erroor comes -------: " Function 'value' returned error code 0x80020005 (DISP_E_TYPEMISMATCH) which means: One or more of the arguments could not be coerced "

The excel workshhet opens with no data.
can anyone tell me why this error comes and whats the
solution.
Thanks
Amar


__________________________________ Do you Yahoo!?


__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com


Yahoo! Groups Sponsor ADVERTISEMENT
Click Here!


Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

Reply via email to