Re: excel find last column

2007-02-09 Thread Tim Golden
Lance Hoffmeyer wrote: > I ran makepy.py and loaded Microsoft Excel Object Library 11.0 > I have imported: > > import win32com.client > from win32com.client import constants > import re > import codecs,win32com.client > import time > import datetime > import win32com.client.dynamic > > > using t

Re: excel find last column

2007-02-09 Thread Lance Hoffmeyer
I ran makepy.py and loaded Microsoft Excel Object Library 11.0 I have imported: import win32com.client from win32com.client import constants import re import codecs,win32com.client import time import datetime import win32com.client.dynamic using this expression lastcol = sh.UsedRange.Find("*",

Re: excel find last column

2007-02-08 Thread [EMAIL PROTECTED]
> > I get the error that xlPrevious is not defined. > If you are using pythonwin, run the COM Makepy utility on Microsoft Excel Object Library. Then you have access to the defined constants as follows. >>> import win32com.client >>> win32com.client.constants.xlPrevious 2 Hope this helps. Paul

excel find last column

2007-02-08 Thread Lance Hoffmeyer
Hi all, I am trying to find the last used column in an excel sheet using win32com: lastcol = sh.UsedRange.Columns.Count works, but only if there is no formatting. I want to allow formatting in the columns. I would rather use the code below because formatted cells are irrelevant. using: last