Skip to content

Instantly share code, notes, and snippets.

@xnrghzjh
Created June 28, 2011 03:56
Show Gist options
  • Save xnrghzjh/1050457 to your computer and use it in GitHub Desktop.
Save xnrghzjh/1050457 to your computer and use it in GitHub Desktop.
Excel2007,2010でxlsファイルを保存する時に出る互換性チェクを無効にする。
import org.codehaus.groovy.scriptom.*
Scriptom.inApartment
{
excel = new ActiveXObject('Excel.Application')
fileList = ["Book1.xls"] // TODO:カレントからxlsファイルを取得する処理
fileList.each() {
book = excel.workbooks.open(new File(it).canonicalPath)
book.CheckCompatibility = false
book.Save
excel.quit()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment