Lance Hoffmeyer <[EMAIL PROTECTED]> writes: > import win32com.client > import re > import codecs > import win32com.client.dynamic > import time > import datetime > from win32com.client.dynamic import Dispatch > from win32com.client import constants
These statements create code objects (some of them module objects) and give them names you can use later. They're like assignment statements, but a shortcut that also makes the code objects. > sh2.Columns(lastcol).HorizontalAlignment = xlCenter > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > NameError: name 'xlCenter' is not defined Yep, since you have no name 'xlCenter' bound to anything. > sh2.Columns(lastcol).HorizontalAlignment = constant.xlCenter > > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > NameError: name 'constant' is not defined Yep, since you have no name 'constant' bound to anything. You do have the name 'constants' though; you imported it from 'win32com.client'. Perhaps that's what you meant? -- \ "I have one rule to live by: Don't make it worse." -- Hazel | `\ Woodcock | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list