Excel Range :: Please help :: urgent

Can anybody please help with any idea about export of excel in x++ with more than 256 columns having some values

when reading an excel with Sys excel classes.

SysRange object should return excel with more than 256 columns having values.

thou, it only returns 256 cloumn excel even if there are 1000 columns in excel while reading it.

Or, do i need to make change in some excel macros?

Please help…

Regards,

Geetika

try this sample code below.

static void excel(Args _args)//SKO

{

SysExcelApplication xlsApplication;

SysExcelWorkBooks xlsWorkBookCollection;

SysExcelWorkBook xlsWorkBook;

SysExcelWorkSheets xlsWorkSheetCollection;

SysExcelWorkSheet xlsWorkSheet;

SysExcelStyles styles;

SysExcelStyle style;

SysExcelFont font;

SysExcelCells cells;

ComVariant _template;

int row = 1;

str endString;

VendTable vendTable;

FileName fileName = “C:\New folder\Test.xlsx”;

;

//adding worksheets

xlsApplication = SysExcelApplication::construct();

xlsWorkBookCollection = xlsApplication.workbooks();

xlsWorkBook = xlsWorkBookCollection.add(_template);

xlsWorkSheetCollection = xlsWorkBook.worksheets();

xlsWorkSheet = xlsWorkSheetCollection.itemFromNum(1);

//Adding columns to the row.

for (row = 1; row < 4; row++)

{

if(row == 1)

{

xlsWorkSheet.cells().item(row, 1).value(’’);

xlsWorkSheet.cells().item(row, 2).value(’’);

xlsWorkSheet.cells().item(row, 3).value(’’);

xlsWorkSheet.cells().item(row, 4).value(’’);

xlsWorkSheet.cells().item(row, 5).value(’’);

xlsWorkSheet.cells().item(row, 6).value(’’);

xlsWorkSheet.cells().item(row, 7).value(’’);

xlsWorkSheet.cells().item(row, 8).value(’’);

xlsWorkSheet.cells().item(row, 9).value(’’);

xlsWorkSheet.cells().item(row, 10).value(’’);

xlsWorkSheet.cells().item(row, 11).value(’’);

xlsWorkSheet.cells().item(row, 12).value(’’);

xlsWorkSheet.cells().item(row, 13).value(’’);

xlsWorkSheet.cells().item(row, 14).value(’’);

xlsWorkSheet.cells().item(row, 15).value(’’);

xlsWorkSheet.cells().item(row, 16).value(’’);

xlsWorkSheet.cells().item(row, 17).value(’’);

xlsWorkSheet.cells().item(row, 18).value(’’);

xlsWorkSheet.cells().item(row, 19).value(’’);

xlsWorkSheet.cells().item(row, 20).value(’’);

xlsWorkSheet.cells().item(row, 21).value(’@FTD1’);

xlsWorkSheet.cells().item(row, 25).value(’@FTD5’);

xlsWorkSheet.cells().item(row, 31).value(’@FTD405’);

xlsWorkSheet.cells().item(row, 45).value(’@FTD405’);

xlsWorkSheet.cells().item(row, 52).value(’@FTD337’);

xlsWorkSheet.cells().item(row, 62).value(’@FTD338’);

xlsWorkSheet.cells().item(row, 83).value(’@FTD217’);

xlsWorkSheet.cells().item(row, 87).value(’@FTD220’);

}

if(row == 2)

{

xlsWorkSheet.cells().item(row, 21).value(’@FTD406’);

xlsWorkSheet.cells().item(row, 22).value(’@FTD406’);

xlsWorkSheet.cells().item(row, 23).value(’@FTD406’);

xlsWorkSheet.cells().item(row, 24).value(’@FTD406’);

xlsWorkSheet.cells().item(row, 25).value(’@FTD407’);

xlsWorkSheet.cells().item(row, 27).value(’@FTD407’);

xlsWorkSheet.cells().item(row, 29).value(’@FTD407’);

xlsWorkSheet.cells().item(row, 62).value(’@FTD211’);

xlsWorkSheet.cells().item(row, 66).value(’@FTD408’);

xlsWorkSheet.cells().item(row, 70).value(’@FTD408’);

xlsWorkSheet.cells().item(row, 74).value(’@FTD409’);

xlsWorkSheet.cells().item(row, 78).value(’@FTD214’);

xlsWorkSheet.cells().item(row, 83).value(’@FTD351’);

xlsWorkSheet.cells().item(row, 85).value(’@FTD352’);

}

if(row == 3)

{

xlsWorkSheet.cells().item(row, 1).value(’@FTD319’);

xlsWorkSheet.cells().item(row, 2).value(’@FTD32’);

xlsWorkSheet.cells().item(row, 3).value(’@FTD322’);

xlsWorkSheet.cells().item(row, 4).value(’@FTD2’);

xlsWorkSheet.cells().item(row, 5).value(’@FTD321’);

xlsWorkSheet.cells().item(row, 6).value(’@FTD320’);

xlsWorkSheet.cells().item(row, 7).value(’@FTD83’);

xlsWorkSheet.cells().item(row, 8).value(’@FTD323’);

xlsWorkSheet.cells().item(row, 9).value(’@FTD324’);

xlsWorkSheet.cells().item(row, 10).value(’@FTD325’);

xlsWorkSheet.cells().item(row, 11).value(’@FTD299’);

xlsWorkSheet.cells().item(row, 12).value(’@FTD403’);

xlsWorkSheet.cells().item(row, 13).value(’@FTD173’);

xlsWorkSheet.cells().item(row, 14).value(’@FTD327’);

xlsWorkSheet.cells().item(row, 15).value(’@FTD86’);

xlsWorkSheet.cells().item(row, 16).value(’@FTD328’);

xlsWorkSheet.cells().item(row, 17).value(’@FTD329’);

xlsWorkSheet.cells().item(row, 18).value(’@FTD330’);

xlsWorkSheet.cells().item(row, 19).value(’@FTD331’);

xlsWorkSheet.cells().item(row, 20).value(’@FTD388’);

xlsWorkSheet.cells().item(row, 21).value(’@FTD389’);

xlsWorkSheet.cells().item(row, 22).value(’@FTD390’);

xlsWorkSheet.cells().item(row, 23).value(’@FTD391’);

xlsWorkSheet.cells().item(row, 24).value(’@FTD392’);

xlsWorkSheet.cells().item(row, 25).value(’@FTD5’);

xlsWorkSheet.cells().item(row, 26).value(’@FTD358’);

xlsWorkSheet.cells().item(row, 27).value(’@FTD5’);

xlsWorkSheet.cells().item(row, 28).value(’@FTD358’);

xlsWorkSheet.cells().item(row, 29).value(’@FTD5’);

xlsWorkSheet.cells().item(row, 30).value(’@FTD358’);

xlsWorkSheet.cells().item(row, 31).value(’@FTD202’);

xlsWorkSheet.cells().item(row, 32).value(’@FTD393’);

xlsWorkSheet.cells().item(row, 33).value(’@FTD204’);

xlsWorkSheet.cells().item(row, 34).value(’@FTD419’);

xlsWorkSheet.cells().item(row, 35).value(’@FTD397’);

xlsWorkSheet.cells().item(row, 36).value(’@FTD396’);

xlsWorkSheet.cells().item(row, 37).value(’@FTD398’);

xlsWorkSheet.cells().item(row, 38).value(’@FTD399’);

xlsWorkSheet.cells().item(row, 39).value(’@FTD349’);

xlsWorkSheet.cells().item(row, 40).value(’@FTD400’);

xlsWorkSheet.cells().item(row, 41).value(’@FTD350’);

xlsWorkSheet.cells().item(row, 42).value(’@FTD401’);

xlsWorkSheet.cells().item(row, 43).value(’@FTD334’);

xlsWorkSheet.cells().item(row, 44).value(’@FTD18’);

xlsWorkSheet.cells().item(row, 45).value(’@FTD420’);

xlsWorkSheet.cells().item(row, 46).value(’@FTD410’);

xlsWorkSheet.cells().item(row, 47).value(’@FTD411’);

xlsWorkSheet.cells().item(row, 48).value(’@FTD412’);

xlsWorkSheet.cells().item(row, 49).value(’@FTD413’);

xlsWorkSheet.cells().item(row, 50).value(’@FTD414’);

xlsWorkSheet.cells().item(row, 51).value(’@FTD336’);

xlsWorkSheet.cells().item(row, 52).value(’@FTD205’);

xlsWorkSheet.cells().item(row, 53).value(’@FTD415’);

xlsWorkSheet.cells().item(row, 54).value(’@FTD347’);

xlsWorkSheet.cells().item(row, 55).value(’@FTD416’);

xlsWorkSheet.cells().item(row, 56).value(’@FTD348’);

xlsWorkSheet.cells().item(row, 57).value(’@FTD417’);

xlsWorkSheet.cells().item(row, 58).value(’@FTD349’);

xlsWorkSheet.cells().item(row, 59).value(’@FTD418’);

xlsWorkSheet.cells().item(row, 60).value(’@FTD350’);

xlsWorkSheet.cells().item(row, 61).value(’@FTD401’);

xlsWorkSheet.cells().item(row, 62).value(’@FTD321’);

xlsWorkSheet.cells().item(row, 63).value(’@FTD402’);

xlsWorkSheet.cells().item(row, 64).value(’@FTD359’);

xlsWorkSheet.cells().item(row, 65).value(’@FTD403’);

xlsWorkSheet.cells().item(row, 66).value(’@FTD321’);

xlsWorkSheet.cells().item(row, 67).value(’@FTD402’);

xlsWorkSheet.cells().item(row, 68).value(’@FTD359’);

xlsWorkSheet.cells().item(row, 69).value(’@FTD403’);

xlsWorkSheet.cells().item(row, 70).value(’@FTD321’);

xlsWorkSheet.cells().item(row, 71).value(’@FTD402’);

xlsWorkSheet.cells().item(row, 72).value(’@FTD359’);

xlsWorkSheet.cells().item(row, 73).value(’@FTD403’);

xlsWorkSheet.cells().item(row, 74).value(’@FTD321’);

xlsWorkSheet.cells().item(row, 75).value(’@FTD402’);

xlsWorkSheet.cells().item(row, 76).value(’@FTD359’);

xlsWorkSheet.cells().item(row, 77).value(’@FTD403’);

xlsWorkSheet.cells().item(row, 78).value(’@FTD321’);

xlsWorkSheet.cells().item(row, 79).value(’@FTD402’);

xlsWorkSheet.cells().item(row, 80).value(’@FTD359’);

xlsWorkSheet.cells().item(row, 81).value(’@FTD403’);

xlsWorkSheet.cells().item(row, 82).value(’@FTD334’);

xlsWorkSheet.cells().item(row, 83).value(’@FTD360’);

xlsWorkSheet.cells().item(row, 84).value(’@FTD361’);

xlsWorkSheet.cells().item(row, 85).value(’@FTD360’);

xlsWorkSheet.cells().item(row, 86).value(’@FTD361’);

xlsWorkSheet.cells().item(row, 87).value(’@FTD353’);

xlsWorkSheet.cells().item(row, 88).value(’@FTD15’);

xlsWorkSheet.cells().item(row, 89).value(’@FTD7’);

xlsWorkSheet.cells().item(row, 90).value(’@FTD8’);

xlsWorkSheet.cells().item(row, 91).value(’@FTD355’);

xlsWorkSheet.cells().item(row, 92).value(’@FTD13’);

xlsWorkSheet.cells().item(row, 93).value(’@FTD356’);

xlsWorkSheet.cells().item(row, 94).value(’@FTD404’);

xlsWorkSheet.cells().item(row, 95).value(’@FTD16’);

xlsWorkSheet.cells().item(row, 96).value(’@FTD339’);

}

}

//Adding header

styles = xlsWorkBook.styles();

style = styles.add(‘Header’);

//Adding font description

font = style.font();

font.bold(true);

xlsWorkSheet.rows().item(row).style(‘Header’);

//row++;

xlsWorkSheet.columns().autoFit();

xlsWorkSheet.rows().item(row).style(‘Header’);

cells = xlsWorkSheet.cells();

xlsWorkBook.saveAs(fileName);

xlsWorkBook.comObject().save();

xlsWorkBook.saved(true);

//row = 1;

xlsApplication.quit();

xlsApplication.finalize();

}