title: Python: Using win32com (or other module) to adjust print properties of excel file
body: <p>i need to print an excel sheet and need to do it using some kind of python script. So far i have used win32com in my script and i also got it done to get a printout using the following code:</p>
  
  <pre><code>import win32com.client
  
  o = win32com.client.Dispatch("Excel.Application")
  o.Visible = 1
  wb = o.Workbooks.Open(r'C:\test.xlsx')
  ws = wb.Worksheets[1]
  ws.PrintOut()
  </code></pre>
  
  <p>Unfortunately before i actually print the excel-sheet i need to adjust the print settings of this sheet/file: change format to landscape and change to small/narrow margin.</p>
  
  <p>I have found this site that might contain just what i need:
  <a href="https://msdn.microsoft.com/en-us/library/aa220363(v=office.11).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/aa220363(v=office.11).aspx</a></p>
  
  <p>Unfortunately so far i have not been able to change the desired print properties. I hope someone can help me with this or at least get me headed into the right direction.</p>