Can anyone help me on how can I overwrite the excel file without prompting the users in VB.Net..
I have try this code but It doesn't work..
Dim xlsApp As New Excel.Application
Dim xlsBook As Excel.Workbook
Dim xlsSheet As Excel.Worksheet
Dim dir As String = Application.StartupPath & "\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 & "\Template\SampleTemplate.xls")
xlsBook = Nothing
xlsSheet = Nothing
xlsApp.Quit()