Wajih,
First check
http://mini.net/tcl/Tcom%20examples%20for%20Microsoft%20Excel
I do have tcom-based code for Excel for at least some
of the cell properties like background. However the code
is not easily abstracted into an example. Can you
post the details of what you've tried and then perhaps
Myself and others can offer concrete suggestions.
>
I did the following database:
# cell Properties for the first header line
set range [$worksheet Range J1 P1]
$application DisplayAlerts [expr 0]
set font [$range Font]
$font Bold [expr 1]
$range HorizontalAlignment $align(horiz,center)
$range VerticalAlignment $align(vert,center)
$range MergeCells [expr 1]
$application DisplayAlerts [expr 1]
# Define a range of cells to use with the following commands.
set range [$worksheet Range A2 P2]
set font [$range Font]
$font Bold [expr 1]
$range Orientation [expr 90]
after this , I added values in the column. However, the column width is
default and therefore , I want these columns to fit to the data size.
for this , I tried many things one is below:
#set beginrange A
#set endrange AN
#set range [$worksheet Range $beginrange $endrange]
This above command does not work. Probably we can not defined the
column range.
then I defined the range with cell like A3 AN3
and enter the following db
$application DisplayAlerts [expr 0]
$range AutoFit [expr 1]
$application DisplayAlerts [expr 1]
does not work also . It says AutoFit should be the argument which might
be correct as there is no TRUE/FALSE option. So I am stuck how to
defined AutoFit.
$application DisplayAlerts [expr 0]
$range ShrinkToFit [expr 1]
$application DisplayAlerts [expr 1]
But this did something else and fit the text in the cell.
So , I do not know have any idea how to adjust the column width to the
suitable size as per data .
Anyone can help?