In my Excel workbook, I can attach an Access database as an OLE object.
I now want to save a copy of this object (Access database) in another folder.
Here is my code:
If nameEnd = "ccdb" Then
'Access Type
Dim AccessApp As Object
Dim obja As OLEObject
Application.ScreenUpdating = False
Set obja = ActiveSheet.OLEObjects(i)
obja.Activate
obja.Visible = True
Set AccessApp = GetObject(, "Access.Application")
AccessApp.CurrentDatabase.SaveAs FileName:=fpath & "AttachmentAccess"
AccessApp.CurrentDb.ExportAsFixedFormat outputfilename:=saveFile & "Attachment DB", _
ExportFormat:=accdbExportFormatPDF
Set AccessApp = Nothing
Range("K2:Z300").Select
Application.ScreenUpdating = True
End If
I get the error "Object doesn't support this property or method" probably because "CurrentDatabase.SaveAs" does not exist as a property.