How to create table in mfc visual studio for excel?

38 Views Asked by At
LPDISPATCH ListObjects::Add(long SourceType, const VARIANT& Source, const VARIANT& LinkSource, long XlListObjectHasHeaders, const VARIANT& Destination, const VARIANT& TableStyleName)

what to pass in each argument

XLS2007::ListObject Tblobj = oListObjs.Add( 1,COleVariant(range1), COleVariant((short)(0)),1,COleVariant(leftRange),COleVariant(oTblObj.tableStyle_Name));
range1 = "$A$1:$J$10;  
  
leftRange =  "$A$1"   ;

it gives the error code = -2147024809 its not able to create table for excel

0

There are 0 best solutions below