Etxezarreta
Member
- Local time
- Tomorrow, 00:42
- Joined
- Apr 13, 2020
- Messages
- 175
Hello everyone,
I open an Access file from an Excel workbook, then I close the Excel, but the access file closes too: it is maybe more an Excel problem than an Access one, but I am not sure:
here is the code, do you have any recomandation please? Many thanks in advance.
Etxe
I open an Access file from an Excel workbook, then I close the Excel, but the access file closes too: it is maybe more an Excel problem than an Access one, but I am not sure:
here is the code, do you have any recomandation please? Many thanks in advance.
Etxe
Code:
Public Sub FermerFichierExel()
Dim appAccess As Object
Dim strPath As String
strPath = ActiveWorkbook.Path
On Error GoTo errSub
Set appAccess = CreateObject("Access.Application")
Call appAccess.OpenCurrentDatabase(strPath & "\GestionProduction_SupplyChain_LGB.accdb")
appAccess.Visible = True
ActiveWorkbook.Close SaveChanges:=True
Exit Sub
errSub:
MsgBox Err.Number & " -- " & Err.Description
End Sub