title: Unable to convert and save excel file into PDF using Python
body: <p>I am trying to import excel files and converting them into PDF using Python. I tried using win32com library but the saved file is not good. Saved PDF only contains first few columns from excel.</p>
  <p>Code:-</p>
  <pre class="lang-py prettyprint-override"><code>import win32com.client
  
  o = win32com.client.Dispatch(&quot;Excel.Application&quot;)
  o.Visible = False
  wb_path = r'c:\user\desktop\sample.xls'
  wb = o.Workbooks.Open(wb_path)
  ws_index_list = [1,4,5] #say you want to print these sheets
  path_to_pdf = r'C:\user\desktop\sample.pdf'
  wb.WorkSheets(ws_index_list).Select()
  wb.ActiveSheet.ExportAsFixedFormat(0, path_to_pdf)
  </code></pre>