在Excel 2011中,使用apple腳本創建了一個額外的系列。Excel 2011中的圖表中創建了一個額外的系列
tell application "Microsoft Excel"
make new workbook
tell worksheet "sheet1" of active workbook
set value of cell "A1" to 10
set value of cell "B1" to 5
set obj to make new chart object at end with properties {left position:100, top:100, height:200, width:300, name:"MyChart"}
set ochart1 to chart of chart object "MyChart"
tell ochart1
set chart type to bar clustered
make new series at end with properties {series values:"=Sheet1!$A$1:$B$1", name:"2"}
end tell
end tell
end tell
我的問題,一個額外的系列(即系列1)在sheet1中創建。
新圖表創建時通常會有一個系列,因此您需要在添加新系列之前刪除所有現有系列 –
請運行我的腳本,一次創建兩個系列。 – user1705318
如果此語句以屬性{系列值:「= Sheet1!$ A $ 1:$ C $ 1」,名稱:「2」}創建新系列,則創建三個系列,即創建兩個系列。 – user1705318