Remote Procedure Call Failed

Robecca

Registered User.
Local time
Today, 02:56
Joined
Jan 5, 2013
Messages
68
I have just started getting this error as of 2/6/17 our database has been functioning since 1/26/15.

I am now running MS Office v2016 after upgrading July 28, 2015.

Microsoft VB
Run-time error '-2147023170 (800706be)':
Automoation Error
The remote procedure call failed.

Here is my code:

Function OpenExcelA3CustShipFromAccess()
' Opens an Excel file and runs a macro to update the data for the template

Dim MyXL As Object

Set MyXL = CreateObject("Excel.Application")
With MyXL
.Application.Visible = True
.Workbooks.Open "C:\DBWT\A3CustShip.xlsm"
.Run "GetData"
End With
End Function

When I click on Debug the .Run "GetData" is highlighted in yellow.

I just started learning VB in 2014 by googling for examples of what I wanted to do, so I am aware my code might not optimal.

Thank you! Robecca
 
The code you posted tries to execute a subroutine called "GetData" in the Excel file "C:\DBWT\A3CustShip.xlsm", and it looks like the failure is occurring in that file. Either the named routine does not exist there, or it returns an error. To troubleshoot, open the Excel file directly and try to find and run the routine from inside the file.
Hope this helps,
 
After getting the error, I have been opening the Excel file and running the macro to finish the report so I can send it. When I open Excel, it has the Document Recovery pane open, I just close it and then run the Get Data macro.

I was thinking I must not have written my code right in Access even though it has worked for 2 years, or my current version of Access wants it differently.
 
In my experience, anything that has been running for some time and then starts failing, it's a data error, corruption, a softwar upgrade or a file has been deleted, changed name or moved.

The fact that the document Discovery pane is open is an indication there's something amiss with the Excel function, not Access.
 
I appreciate all the comments and ideas. Since I can run the macro from within Excel, I uninstalled Office and reinstalled and same issue. I will contact our IT person. Thank you!
 

Users who are viewing this thread

Back
Top Bottom