如何使用Apple脚本创建Microsoft Excel文件

时间:2013-01-31 04:01:21

标签: excel applescript applescript-excel

如何使用apple脚本创建名称为excel的文件? 在此脚本中,将创建excel文件,但未设置工作簿名称。

tell application "Microsoft Excel"
      make new workbook at end with properties{name:"MyIndia"}
end tell 

1 个答案:

答案 0 :(得分:0)

尝试:

tell application "Microsoft Excel"
    set myWorkbook to make new workbook
    save workbook as myWorkbook filename "My Workbook Name"
end tell

要在保存Excel文件之前获取工作簿的名称:

tell application "Microsoft Excel"
    set myWorkbook to make new workbook
    return myWorkbook's name
end tell