mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
f14180707d
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
22 lines
560 B
Ruby
22 lines
560 B
Ruby
require 'win32ole'
|
|
|
|
#application = WIN32OLE.new('Excel.Application.5')
|
|
application = WIN32OLE.new('Excel.Application')
|
|
|
|
application.visible = TRUE
|
|
workbook = application.Workbooks.Add();
|
|
worksheet = workbook.Worksheets(1);
|
|
worksheet.Range("A1:D1").value = ["North","South","East","West"];
|
|
worksheet.Range("A2:B2").value = [5.2, 10];
|
|
worksheet.Range("C2").value = 8;
|
|
worksheet.Range("D2").value = 20;
|
|
|
|
range = worksheet.Range("A1:D2");
|
|
range.Select
|
|
chart = workbook.Charts.Add;
|
|
|
|
workbook.saved = TRUE;
|
|
|
|
application.ActiveWorkbook.Close(0);
|
|
application.Quit();
|
|
|