Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 3, 2020
1 parent b433d53 commit 8c2234a
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Win32ole
# WIN32OLE

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/win32ole`. To experiment with that code, run `bin/console` for an interactive prompt.
WIN32OLE objects represent OLE Automation object in Ruby.

TODO: Delete this and the text above, and describe your gem
By using WIN32OLE, you can access OLE server like VBScript.

## Installation

Expand All @@ -22,7 +22,27 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
```
require 'win32ole'
excel = WIN32OLE.new('Excel.Application')
excel.visible = true
workbook = excel.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;
excel.ActiveWorkbook.Close(0);
excel.Quit();
```

## Development

Expand All @@ -32,5 +52,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hsbt/win32ole.
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/win32ole.

0 comments on commit 8c2234a

Please sign in to comment.