![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Change width of Excel Column Here's the script ------------------- $a = New-Object -comobject Excel.Application $a.Visible = $True $b = $a.Workbooks.Add() $c = $b.Worksheets.Item(1) $c.Cells.Item(1,1) = "Service Name" $c.Cells.Item(1,2) = "Service Status" How can I set the width of the first column? I've been digging around the excel object model and I'd think... $c.Columns("1").ColumnWidth = 50 would work, but it doesn't. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Change width of Excel Column Postimg it again, problem with my news reader I guess, sorry. ------------------------------------------------------------- Subject: Re: Change width of Excel Column 7/23/2008 4:52 PM PST By: Kiron In: microsoft.public.windows.powershell Pretty close, just needed the .item and the [int] w/o quotes: $c.columns.item(1).columnWidth = 50 # or... $c.columns.item('a').columnWidth = 50 # other options... $c.cells.item(1).columnWidth = 50 # or... $c.range('a:a').columnwidth = 50 -- Kiron |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Change width of Excel Column "Kiron" wrote: Quote: > > Pretty close, just needed the .item and the [int] w/o quotes: > > $c.columns.item(1).columnWidth = 50 > # or... > $c.columns.item('a').columnWidth = 50 object. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
Column width | General Discussion | |||
| formatting output column width | PowerShell | |||
| fixed width column import | PowerShell | |||
| Excel 2007 Column and Width pixels not showing | Vista General | |||
| Details View Column Width Defaults (Registry ??) | Vista General | |||