[Solved]Saving Excel file from within access
Hello, I've spent hours trying to solve my problem and tried so many solutions and none have worked.
Basically from within access I'm opening an excel file, editing it, then closing and saving it.
It works until I get to closing and saving it, when I close it, it prompts me to save and if I click yes it goes to a SaveAs screen.
I would like it to save automatically when it gets closed so the user doesn't get prompted with anything. I also want it to override the current file opened and not a new save.
Edit: Should note I'm using access 2007
Here is some code I'm using:
Any help will be welcomed, thanks.
Kind regards,
Peter
Hello, I've spent hours trying to solve my problem and tried so many solutions and none have worked.
Basically from within access I'm opening an excel file, editing it, then closing and saving it.
It works until I get to closing and saving it, when I close it, it prompts me to save and if I click yes it goes to a SaveAs screen.
I would like it to save automatically when it gets closed so the user doesn't get prompted with anything. I also want it to override the current file opened and not a new save.
Edit: Should note I'm using access 2007
Here is some code I'm using:
Code:
Dim appxl As Object
Set appxl = CreateObject("Excel.Application")
appxl.Visible = False
appxl.Workbooks.Open "C:.....xlsx"
appxl.Sheets("Sheet1").Select
**edits to excel worksheet done here**
appxl.Workbooks.Close
Any help will be welcomed, thanks.
Kind regards,
Peter
Last edited: