PDA

View Full Version : RunTime error 462 - The remote Server machine does not exist.



gilmapaiya
03-02-2013, 12:38 AM
I am trying a simple transfer data from Excel to Access database but I keep getting this error if I try it the second time. First time it works fine. based on Microsoft article, I am not able to fix the issue. Can some one help please?


Dim acApp As Object

mysheet = "C:\Incident3.xlsx"
myrange = "Sheet1!A1:G12"

Set acApp = CreateObject("Access.Application")
acApp.OpenCurrentDatabase ("C:\MyTest1.accdb")
'acApp.Visible = True
'acApp.UserControl = True
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "MyTable400", mysheet, True, myrange
acApp.CloseCurrentDatabase
acApp.Quit
Set acApp = Nothing


End Sub