Today's Smalltalk Daily looks at working with Excel from Smalltalk. Here's the workspace I used in the screencast:
"Excel Demonstration"
excel := COMDispatchDriver createObject: 'Excel.Application'.
"Open Excel"
excel setVisible: true.
excel getWorkbooks Add.
sheet := excel getActiveSheet.
"Write some data"
(excel getRange: 'A1') setValue: 'Name'.
(excel getRange: 'A2') setValue: 'Fred Flintstone'.
(excel getRange: 'A1:A2') getFont setBold: true.
"Read a cell"
(excel getRange: 'A1') getValue.
"Copy Cells"
(excel getRange: 'A1:A2') Select.
excel setCutCopyMode: false.
excel getSelection Copy.
Transcript show: Screen default getExternalSelection.
To watch, click on the viewer below:
If you have trouble viewing that directly, you can click here to download the video directly
You can also watch it on YouTube:
Technorati Tags:
excel, windows, COM, visualworks