title: Unable to set the Orientation property of the PageSetup class in Excel Program
body: <p>I have written following code in .Net</p>
  
  <pre><code>excel = New Excel.Application
  wBook = excel.Workbooks.Add()
  wSheet = wBook.ActiveSheet()
  wSheet.PageSetup.Orientation = XlPageOrientation.xlLandscape
  </code></pre>
  
  <p>When i run this from local sytem it is working  and when i copy this to a server and will be run from a service giving following error.</p>
  
  <p>Unable to set the Orientation property of the PageSetup class</p>