title: Anaconda Saving to existing excel file
body: <p>I have written a a short program in Python to save a dataframe into an existing excel file. it goes as follows:</p>
  
  <pre><code>def Save_To_Excel(self, path_save, df, sheet_name, startrow, startcol):    
      self.path = path_save
      self.df = df
      self.startrow = startrow
      self.startcol = startcol
      self.sheet_name=sheet_name
  
      #writer = pd.ExcelWriter(self.path, engine = 'openpyxl')
      #self.df.to_excel(writer, sheet_name = self.sheet_name, index='False')
      book = load_workbook(self.path)
      with pd.ExcelWriter(self.path, engine='openpyxl') as writer:
          writer.book = book
          writer.sheets = dict((ws.title, ws) for ws in book.worksheets)    
          self.df.to_excel(writer, sheet_name=self.sheet_name, starrow=self.startrow, startcol=self.startcol)      
  
   #   with pd.ExcelWriter(self.path, engine='xlsxwriter') as writer:  
   #       self.df.to_excel(writer, sheet_name=self.sheet_name, starrow=self.startrow, startcol=self.startcol)      
  
      writer.save() 
      writer.close()
  </code></pre>
  
  <p>However I get the following error message:</p>
  
  <p>File "C:\Users...\Anaconda3\lib\site-packages\openpyxl\reader\excel.py", line 78, in _validate_archive
      file_format = os.path.splitext(filename)[-1].lower()</p>
  
  <p>File "C:\Users...\Anaconda3\lib\ntpath.py", line 202, in splitext
      p = os.fspath(p)</p>
  
  <p>TypeError: expected str, bytes or os.PathLike object, not DataFrame
  Do anyone have any idea what is wrong with the code?</p>