How to make number of columns in excel fixed?

excel
uiautomation
activities
studio

#1

the number of columns should be fixed and other than that number the message should written in log file.

thank you.