How to change the version of Excel using X++ code

Were you able to identify Which line of code is causing that error?