I have Access open an Excel spreadsheet, then Access makes some changes to the spreadsheet, and then I need Access to save the spreadsheet. I can do this, but when it saves the file, I get the message "A file named 'P&L 2024.xls' already exists in this location. Do you want to replace it?". I just want to save the file - YES, but not as a new file. I hope this makes sense. The code is as follows:
I appreciate any help.Code:Dim objXLApp As Object Dim objXLBook As Object Dim objWorkSheet As Object pubStrYrSpecial = "2024" ' open p&l Set objXLApp = CreateObject("Excel.Application") Set objXLBook = objXLApp.Workbooks.Open("L:\aaTS\Data\P&L 2024.xls") Set objWorkSheet = objXLBook.Worksheets(pubStrYrSpecial) ' Access makes some changes to the workbook ' save and close the workbook objXLBook.Save objXLBook.Close objXLApp.Quit Set objXLApp = Nothing