I am tryng to run this module on Access:
Public Sub Retriever_P(path)
DoCmd.TransferSpreadsheet acImport, 10, "Product_Details", path, True, ""
End Sub
From this VBA code in Excel
Private Sub CommandButton210_Click()
Dim appAccess As Access.Application
Set appAccess = New Access.Application
Dim Target As String: Target = ThisWorkbook.Sheets("CODE").Cells(8, 4).Value
Dim path As String: path = ThisWorkbook.Sheets("CODE").Cells(5, 13).Value
appAccess.OpenCurrentDatabase Target
appAccess.Visible = True
appAccess.DoCmd.SetWarnings False
appAccess.UserControl = True
appAccess.DoCmd.OpenQuery "Clean Product_Details"
appAccess.Run "Retriever_P", path
appAccess.CloseCurrentDatabase
End Sub
But I get this Error 2517, "Microsoft Access cannot find the procedure "Retriever_P"
The Excel code is part of a bigger macro that creates a DB and then sends it to access. Any Ideas?
Thank you in advance!