Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

should be simple - setting Excel column widths

Status
Not open for further replies.

jender624

Programmer
Jul 1, 2003
50
US
What is the correct syntax for setting the column width of an excel worksheet object?

I've been trying this:

wsSheet.Columns(0).ColumnWidth = 100

but keep getting an application defined or object defined error.

Thanks,

jender624
 
Did you remember to reference the Excel object (can't tell you how many times I've been bitten by that one!)?

< M!ke >
 
AAAAAARRRGGG, I'm dumb. I'm sorry, I forgot I put an autofit at the end of my procedure. I actually was doing it right originally, but any changes in width were wiped out by the autofit, which I didn't realize. Sorry to have wasted your time.

Thanks anyway!

jender624
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top