Skip to content

Commit

Permalink
create workbook if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanwerner committed Apr 11, 2018
1 parent 254a386 commit 91abc2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Examples/excel-scripting.r
Expand Up @@ -9,9 +9,13 @@
#

#
# get a reference to the workbook
# get a reference to the workbook. create a new one if
# it doesn't exist (you're on the start screen?)
#
wb <- EXCEL$Application$get_ActiveWorkbook();
if(is.null(wb)){
wb <- EXCEL$Application$get_Workbooks()$Add();
}

#
# add a sheet
Expand Down

0 comments on commit 91abc2f

Please sign in to comment.