> from win32com.client import constants > sh2.Columns(lastcol).HorizontalAlignment = constant.xlCenter > NameError: name 'constant' is not defined 1. So why not try reading the error message and fixing the problem instead of thrashing about madly? 2. You have run makepy on your Excel library, haven't you?