Excel 2007 Crasher in one Immediate Windo Line

Roopher

Board Regular
Joined
Jul 8, 2008
Messages
73
Hello!

I just have discovered a surefire way to crash my Exel 2007:

Trying to change the .ColumnWidth of 3 columns at once, I receive strange behaviour, and a subsequently forever-looping application. In the immediate window I type:

Code:
Activesheet.Columns("A:C").ColumnWidth=Array(5,15,50)

Can someone confirm this? Or better give me a fix for it? At least the three columns do have the desired widths when I run the line...


Thanks!
 
Re: Excel 2007 Crasher in one Immediate Window Line: No one?

No one had a go with the statement I posted? Craving feedback, since I'd love to use that line in my code!

...is this line working as expected on you machine?

Code:
Activesheet.Columns("A:C").ColumnWidth=Array(5,15,50)


Thank You again!
 
Upvote 0
Not restricted to xl2007. Same thing in xl2003.
At a guess I would say it is setting the column width for each row in the sheet, which is giving the looping affect.

This appears to work.
Code:
Activesheet.Columns("A:C").rows(1).ColumnWidth=Array(5,15,50)
 
Upvote 0
Yes, Andy, it's working now for me too. Now I can save 5 unneccesary lines of code to loop those colums :) Thank You very much!
 
Last edited:
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top