Friday, September 26, 2014

Pseudocode to create multiple sheets in Excel

With ExcelBuf Do Begin
  SetUseInfoSheed;
  AddInfoColumn ('Company Name',False,'',True,False,False,'');
  AddInfoColumn (CompanyName,False,'',False,False,False,'');
  ClearNewRow;
  NewRow;
  AddColumn ('Sheet',False,'',True,False,False,'');
  AddColumn ('#1',False,'',True,False,False,'');
  CreateBook;
  CreateSheet('#1','Test Excel',CompanyName,UserID);
  DeleteAll(False);
  ClearNewRow;
  NewRow;
  AddColumn('Sheet',False,'',True,False,False,'');
  AddColumn('#2',False,'',True,False,False,'');
  CreateSheet('#2','Test Excel',CompanyName,UserID);
  DeleteAll(False);
  GiveUserControl;
END;


Source : http://dynamicsuser.net/forums/p/23242/120607.aspx