From: Jan Svitok Date: 2006-11-20T01:27:15+09:00 Subject: Re: help with require in win32ole On 11/19/06, Li Chen wrote: > Jan Svitok wrote: > > You have to define the moduke ExcelConst, because it is not a part of > > the library, it is *your* module that the library will fill with > > constants (see the line with WIN32OLE.const_load). > > If it isn't part of the library of WIN32OLE, then where does it come > from, from the Excel library? Sorry I wasn't clear enough. It's a design decision of WIN32OLE that it doesn't create the constants by default. However, it provides the possiblity to create them on demand. So in the case you need the constants, you say where you want them, and the library creates them for you. The place where you want them is the part you have to provide (any module/class). Obviously the constants come from the OLE object (in this case from Excel). WIN32OLE reads them and after a bit of translation creates them in the place you've told it. In conclusion what I wanted to say by that line is that: - The library will work without the ExcelConst module as happily - It's you who has to create the module if you want the constants - However you can name it anyway you want - e.g. XlConst is as good as any other name - It's possible to do without even creating the module by using WIN32OLE or Kernel