Add this code to the WriteSheet() function before setting the orientation:
XlWrkShtWriter.SetColumnWidth('B',120);
And use the following code to create a new workbook:
xlBuffer.CreateBook('','Sheet1');
xlBuffer.AddColumn('Some text',FALSE,'',FALSE,FALSE,FALSE,'',xlBuffer."Cell Type"::Text);
xlBuffer.SetSkipAutoFit(); // Important to use this function if you want to have custom column width
xlBuffer.WriteSheet('','','');
xlBuf.CloseBook;
xlBuf.OpenExcel;
xlBuf.GiveUserControl;
It's just an example, you have to create function to save columns names and width to some variable and then use it in WriteSheet() function.
Keep in mind that in this case you will have to specify width for all columns as AutoFit function is disabled.
Answers
Add this code to the WriteSheet() function before setting the orientation:
And use the following code to create a new workbook:
It's just an example, you have to create function to save columns names and width to some variable and then use it in WriteSheet() function.
Keep in mind that in this case you will have to specify width for all columns as AutoFit function is disabled.