После некоторых поисков я нашел макрос для экспорта в таблицу Excel в качестве записи в защищенный паролем доступ к базе данныхЭкспорт Excel лист Access DB макросъемки
Dim cnn As ADODB.Connection 'dim the ADO collection class
Dim rst As ADODB.Recordset 'dim the ADO recordset class
Dim dbPath
Dim i As Long
'add error handling
On Error GoTo errHandler:
'Variables for file path and last row of data
dbPath = ("\\serverpath\reporting.accdb")
'Initialise the collection class variable
Set cnn = New ADODB.Connection
cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbPath, , "password"
Set rst = New ADODB.Recordset 'assign memory to the recordset
rst.Open Source:="table", ActiveConnection:=cnn, _
CursorType:=adOpenDynamic, LockType:=adLockOptimistic, _
Options:=adCmdTable
rst.AddNew
For i = 1 To 180
rst(Cells(1, i).Value) = Cells(nextrow, i).Value
Next i
rst.Update
'close the recordset
rst.Close
' Close the connection
cnn.Close
'clear memory
Set rst = Nothing
Set cnn = Nothing
'communicate with the user
MsgBox " The data has been successfully sent to the access database"
'Update the sheet
Application.ScreenUpdating = True
On Error GoTo 0
Exit Sub
errHandler:
'clear memory
Set rst = Nothing
Set cnn = Nothing
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Export_Data"
Я получаю сообщение об ошибке «Error 2147217843 Информация рабочей группы файл отсутствует»в cnn.Open
Посмотрите на [это] (https://social.msdn.microsoft.com/Forums/windows/en-US/2cdb0394-b757-4b4c-96e6-927100d8eebd/cannot-start-your- application-workgroup-information-file-is-missing-or-open-exclusive-by) – ZwoRmi