You really should read the information in the link posted by @Viorel .
Since you're not doing any error checking in your code I don't think you'll have much success in discovering the problem. The most likely cause is that the New-Object is failing and the variable "$x1" contains a $null value.
If you're going to write code that runs on a Windows server and works with Excel files then you should be using the ImportExcel PowerShell module: 7.0.1. The module does not use MS Office objects and works only with the software delivered with MS Windows (both client and server).