diff --git a/lib/msoffice.js b/lib/msoffice.js index 32fd718..d33ff33 100644 --- a/lib/msoffice.js +++ b/lib/msoffice.js @@ -72,6 +72,10 @@ function Excel() { } else { this.currentWorksheet = this.currentWorkbook.Worksheets(idx); } + + // switch to the worksheet + this.currentWorksheet.Activate(); + return this; }; @@ -119,7 +123,7 @@ function PowerPoint() { console.info("Microsoft Office PowerPoint", this.version); - this.currentPresentation = null; + this.currentPresentation = null; this.open = function(filename) { if (typeof filename !== "undefined") { @@ -129,16 +133,16 @@ function PowerPoint() { } if (FILE.fileExists(filename)) { console.info("FOUND", filename); - this.application.Presentations.Open(filename); - this.currentPresentation = this.application.ActivePresentation; + this.application.Presentations.Open(filename); + this.currentPresentation = this.application.ActivePresentation; } else { console.warn("NOT FOUND", filename); - this.currentPresentation = this.application.Presentations.Add(true); + this.currentPresentation = this.application.Presentations.Add(true); } } else { this.currentPresentation = this.application.Presentations.Add(true); } - //this.selectPresentation(1); + //this.selectPresentation(1); }; this.selectPresentation = function(idx) { @@ -223,7 +227,7 @@ exports.Excel = Excel; exports.PowerPoint = PowerPoint; exports.Word = Word; -exports.VERSIONINFO = "Microsoft Office interface (msoffice.js) version 0.2.0"; +exports.VERSIONINFO = "Microsoft Office interface (msoffice.js) version 0.2.1"; exports.AUTHOR = "gnh1201@catswords.re.kr"; exports.global = global; exports.require = global.require;