I'm having some issues where my Access project will open an Excel workbook, delete the first row, then save and close it and repeat 5 times. My only problem is every single time it runs it always exports with backup copies.
Example: File1.xls Backup of File1.xls also gets saved too for some reason. Any idea what I am doing wrong? Is it making the backup due to some kind of write protection f the open file?
Public Sub RemoveFirstRowExcel(SSFile As String)
On Error GoTo Exit_Proc
Dim xlApp As Object
Dim xlSheet As Object
Set xlApp = CreateObject("Excel.Application")
Set xlSheet = xlApp.Workbooks.Open(SSFile).Sheets(1)
With xlApp
'.Application.Sheets(SSSheet).Select
.Application.Rows("1:1").Select
.Application.Selection.EntireRow.Delete
.Application.ActiveWorkbook.Close SaveChanges:=True
.Quit
End With
Exit_Proc:
Set xlApp = Nothing
Set xlSheet = Nothing
End Sub