title: How do I send my output xls files to a specific path in python?
body: <p>How do i make my df.to_excel function write to an output path? After my script runs, I do not see the files in the output_path directory i have defined.</p>
  <pre><code>import pandas as pd
  from openpyxl import load_workbook
  import os
  import datetime
  
  output_path = 'C:/Users/g/Desktop/autotranscribe/python/Processed'
  
  path = 'C:/Users/g/Desktop/autotranscribe/python/Matching'
  
  cols_to_drop =  ['PSI ID','PSIvet Region','PSIvet region num','Fax','County']               
   
  column_name_update_map = {'Account name': 'Company Name','Billing address':'Address','Billing city':'City','Billing State':'State'} 
  
  for file in os.listdir(&quot;C:/Users/g/Desktop/autotranscribe/python/Matching&quot;):
      if file.startswith(&quot;PSI&quot;) and &quot;(updated headers)&quot; not in file:
          dfs = pd.read_excel(file, sheet_name=None,skiprows=5)
          output = dict()
          for ws, df in dfs.items():
              if ws.startswith(&quot;Cancelled Members&quot;): df = df.drop('Active date', axis=1)
              if any(ws.startswith(x) for x in [&quot;New Members&quot;,&quot;PVCC&quot;]):
                  continue
              #if ws in [&quot;New Members 03.22&quot;,&quot;PVCC&quot;]:   #sheetstoavoid
              temp = df
              dt = pd.to_datetime(os.path.getctime(os.path.join(path,file)),unit=&quot;s&quot;).replace(nanosecond=0)
              output[ws] = temp
          writer = pd.ExcelWriter(f'{file.replace(&quot;.xlsx&quot;,&quot;&quot;)} (updated headers).xlsx')
          for ws, df in output.items():
              df.to_excel(writer, index=None, sheet_name=ws)
          writer.save()
          writer.close()
  </code></pre>
  <p>I tried <code>df.to_excel(writer,output_path, index=None, sheet_name=ws)</code></p>
  <p>But i get an error
  File &quot;&quot;, line 36, in 
  df.to_excel(writer,output_path, index=None, sheet_name=ws)</p>
  <p>TypeError: to_excel() got multiple values for argument 'sheet_name'.</p>