On 11/19/06, Li Chen <chen_li3 / yahoo.com> wrote:
> > 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
>
> Hi Jan,
>
> Thank you very much for the explanations.
>
> Could you please give me a small example of "doing it without even
> creating the module by using WIN32OLE or Kernel"?

(not tested: I've made up this from documentation, the change is in
the last two lines)

require 'win32ole'

excel = WIN32OLE.new("Excel.Application")
workbook = excel.Workbooks.Add
excelchart = workbook.Charts.Add
....
WIN32OLE.const_load(excel) # missing ..., ExcelConst)
excelchart.ChartType = WIN32OLE::XlConeCol # ExcelConst -> WIN32OLE