Greetings...
I am using the code below to export from Excel directly into an Access db.
The code works perfectly but I would like to be able to accomplish this without actually opening the Access db
Also, I'm using an 'On Error Resume Next' to trap the instance if the db is already open which is fine, but I may not want to resume in the case of 'other' errors - The error # is 7867... What I would want the code to do is in the event the db is already open, then 'Resume Next', in the case of any other error then do something different...
Thank You for your help...
I am using the code below to export from Excel directly into an Access db.
The code works perfectly but I would like to be able to accomplish this without actually opening the Access db
Code:
Sub UploadMorningData3()
On Error Resume Next
Dim AppAccess As Access.Application
Set AppAccess = Access.Application
Call AppAccess.OpenCurrentDatabase("Z:\SanFran\Common10\Sales_DB BACKUP\PIW\SalesRpt\Apps\Sales.accdb")
AppAccess.DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblSalesRpt", Application.ActiveWorkbook.FullName, True, "SalesData!A1:BI2"
End Sub
Also, I'm using an 'On Error Resume Next' to trap the instance if the db is already open which is fine, but I may not want to resume in the case of 'other' errors - The error # is 7867... What I would want the code to do is in the event the db is already open, then 'Resume Next', in the case of any other error then do something different...
Thank You for your help...