2011-01-12 3 views
0

에서 엑셀 COM 인터페이스 컬렉션을 사용할 수 있습니다어떻게 수행하여 내가 셀에 값을 설정할 수 있습니다 엑셀 COM 자동화 인터페이스를 사용하여 영상 작품

excel := COMDispatchDriver createObject: 'Excel.Application'. 
excel getWorkbooks Add. 
excel setVisible: true. 
(excel getRange: 'A1') setValue: 100 

나는 컬렉션이 작업을 수행 할 수있는 방법이 있나요 뭔가 같은 :

excel := COMDispatchDriver createObject: 'Excel.Application'. 
excel getWorkbooks Add. 
excel setVisible: true. 
(excel getRange: 'A1:A4') setValue: #(1 2 3 4) 

답변

2
ExcelApplicationController 

| cont | 
cont := (Examples.Excel97ApplicationController new). 
[ 
    cont addWorkbook. 
    cont isVisible: true. 

    "Insert the title of our report." 
    cont caption: 'First Quarter Results'. 

    cont setRange: 'B5:E9' 
    to: #(#(10 20 30 40) #(1 2 3 4) #(101 201 301 401) #(102 203 305 407)). 


] ensure:[ 
    cont notNil 
     ifTrue: [ 
      cont release. 
      cont := nil ] 
]