JScript/WSH ã§ï¼Excelãã¡ã¤ã«ãèªã¿æ¸ãããã
JScriptããExcelãæä½ããã³ã¼ãã
- æ°è¦Excelãã¡ã¤ã«ã®èªåçæ
- æ¢åã®ããã¯ã®èªã¿æ¸ã
ãªã©ã§ãã¦ä¾¿å©ã
ä¸è¨ã®ã¹ã¯ãªãããä¿åãã¦ï¼ããã«ã¯ãªãã¯ãããâ Excelãçæãããã
hoge.js
var filename = "ã¨ã¯ã»ã«.xls"; // å®æ° var xlMaximized = -4137; // Excelãç«ã¡ä¸ãã var excel = WScript.CreateObject("Excel.Application"); excel.Visible = true; // æ°è¦ã¯ã¼ã¯ããã¯ãä½æ excel.Workbooks.Add(); // æ¢åã®ããã¯ãéãããå ´åã¯ï¼ãããã«ä¸è¨ãå®è¡ã //excel.Workbooks.Open( filename ); var book = excel.Workbooks( excel.Workbooks.Count ); // ã¯ã¼ã¯ããã¯ãåå¾ excel.ActiveWindow.WindowState = xlMaximized; // æ大å // ããã¯ãç·¨é var sheet = book.WorkSheets("Sheet1"); // ã·ã¼ããåå¾ sheet.Cells( 1, 1 ).Value = "hoge"; sheet.Cells( 1, 2 ).Formula = "=1+1"; // ããã¯ãä¿å excel.DisplayAlerts = false; // æ¢åãã¡ã¤ã«ããã£ã¦ãä¸æ¸ããã book.SaveAs( filename ); // Excelãéãã¦çµäº excel.Quit(); excel = null;
æ¦èª¬ï¼
- excel.Workbooks.Count
- ç¾å¨ã®Excelãéãã¦ããã¯ã¼ã¯ããã¯ã®ç·æ°
- æ¢åã®ããã¯ãéã
è£è¶³
Excel.Applicationã«ã¤ãã¦ã®å ¥æå¯è½ãªæ å ±ã¯ï¼ã ãããVBScriptã ãJScripterã«ã¯å°ãã
VBScript ãã Excel ã使ãï¼ãã nakagami ã®æ¥è¨ï¼So-netããã°
http://nakagami.blog.so-net.ne.jp/200...
WSH(vbscript)ããExcel ãæä½ãã
http://www012.upp.so-net.ne.jp/scotch...
ï¼âãªã³ã¯åãï¼
Excel ã®å¦ç ( VBScript ã®ã¯ã©ã¹ )
http://winofsql.jp/VA003334/asp051106...
ãããï¼ä»åã®ã³ã¼ãã§æãããã¿ã¼ã³ãããã£ã¦ãã¾ãã°ï¼ãã¨ã¯VBAã§ãã¤ãæ¸ãã¦ããã³ã¼ããå¿ å®ã«JavaScriptã®ä¸çã«æã£ã¦ããã ãã
é¢é£ããè¨äºï¼
Excelããã¯ã®ãã·ã¼ãç®æ¬¡ããï¼èªåçã«ä½æããããããï¼WSH/JScriptã§ï¼åã·ã¼ãã¸ã®ãªã³ã¯ä»ãã®ç®æ¬¡ãèªåçæï¼
http://language-and-engineering.hatenablog.jp/entry/20110921/p1
Excelã®ãã¯ããå¤é¨ã«å¸ãåºãã¦ä¿åããããããï¼WSH/JScriptã§ï¼VBAã®ã½ã¼ã¹ã³ã¼ãã ããæãåãï¼
http://language-and-engineering.hatenablog.jp/entry/20100524/p1
JScript / VBScript (WSH)ã§ï¼IEãèªåæä½ããã
http://language-and-engineering.hatenablog.jp/entry/20090713/p1