I just figure out that this one works.
XlApp:= CreateOleObject('Excel.Application');
xlapp.Visible := TRUE;
XlApp.ActiveSheet.Columns['A:A'].Hidden := True; // hide
XlApp.ActiveSheet.Columns['A:A'].Hidden := False; // unhide
"Glenn B. Lawler" <[EMAIL PROTECTED]> wrote:
Adrian,
> Im trying to come up a way to hide or unhide a column in excel sheet using
>delphi. Right I can use this command to hide or unhide a column in excel
>
> Excel.Selection.ColumnWidth := 0; // hide
> Excel.Selection.ColumnWidth := 20; // unhide
>
> Is there other way of doing this same as vba. See below:
>
> Selection.EntireColumn.Hidden = True
What happens if you do:
Excel.Selection.EntireColumn.Hiddend:=True;
Have you tried that?
Glenn Lawler
www.incodesystems.com
---------------------------------
Never miss a thing. Make Yahoo your homepage.
[Non-text portions of this message have been removed]