Constants from Excel?

Tim Roberts timr at probo.com
Thu Feb 26 01:09:03 EST 2004


I've done a lot of COM work from Python, including control of the Office
applications.  However, I have a question that I've never been able to
answer.

Is there a way to programmatically fetch the values of COM constants?  For
example, in my Excel apps, I have a section like this, that I have gleaned
from multiple Google posts:

  xlPortrait = 1   # orientation constants
  xlLandscape = 2
  xlWKS = 4        # SaveAs format constants
  xlExcel9795 = 43
  xlHAlignRight = -4152
  xlHAlignCenter = -4108

This works, but it'd be nicer to create an instance of, say,
Excel.Constants and pull the values from there.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list