deevaetodin
Technical User
Hi,
I am using the following code launched with autoexec macro to open up an excel sheet when the database is opened automatically.
Function OpenExcelAp()
Dim objExcel As Object
Dim file As String
file = "N:\test.xls"
Set objExcel = New Excel.Application
With objExcel
'Open the file
.Workbooks.Open FileName:=file
'Make it visible
.Visible = True
.Application.WindowState = xlMinimized
End With
End Function
What I need to do is have another script that will automatically shut and save the excel application when the Access database is closed. How can I alter this script, and I assume this code could then be attached to a command button that would shut down everything.
Any help is appreciated.
D.