From: Jan Svitok Date: 2006-11-13T02:09:58+09:00 Subject: Re: Help with correct syntax in win32ole and excel On 11/12/06, Li Chen wrote: > Hi all, > > I want to use win32ole to do some automation with excel. Here is a line > code > which works. > ... > ChartTypeVal=4 > excel.Range("a1:b3").Select(); > excelchart = workbook.Charts.Add(); > excelchart.Type = ChartTypeVal; > ... > > I check Excel documentation: ChartTypeVal=4 is to draw a graph with > line and the name for this graph type is called xlLine. But when I > replace number 4 with name "xlLine" the script doesn't work. Which > syntax is used so that Ruby knows xlLine instead of number 4? > > Thank you in advance, > > Li Try prefixing it with something. I've found at [1] that they refer to it as Excel.XlChartType.xlLine So try something similar. [1] http://msdn2.microsoft.com/en-gb/library/microsoft.office.tools.excel.chart.linegroups(VS.80).aspx