title: How to overwrite an excel application without prompting the users
body: <p>Can anyone help me on how can I overwrite the excel file without prompting the users in VB.Net..</p>
  
  <p>I have try this code but It doesn't work..</p>
  
  <pre><code>Dim xlsApp As New Excel.Application
  Dim xlsBook As Excel.Workbook
  Dim xlsSheet As Excel.Worksheet
  Dim dir As String = Application.StartupPath &amp; "\Template\SampleTemplate.xls"
  xlsBook = GetObject(dir)
  xlsSheet = xlsBook.Sheets("Per BPA Error Report")
  
  
  xlsSheet.Range("C2:T2").Merge()
  
  xlsApp.DisplayAlerts = False
  xlsSheet.SaveAs(Application.StartupPath &amp; "\Template\SampleTemplate.xls")
  xlsBook = Nothing
  xlsSheet = Nothing
  xlsApp.Quit()
  </code></pre>