hi ...
welcome to TSDN ...
as far as i know you cannot use JavaScript for scripting something in an excel-application ... you only may use it with a browser. could you please describe the use-case that you have?
kind regards
in our task we are downloading data to excel sheet with all cells as protective except 5 cells which are editable, users are copying some data and paste it in the new sheet but we dont require this environment. so we want to restrict the code to disable copy functionality