ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   The RPC Server is unavailable. (https://www.excelbanter.com/excel-programming/346570-rpc-server-unavailable.html)

svhell

The RPC Server is unavailable.
 
I have made a macro to extract data from MSProject.
The macro runs the first time without any problems.
But if I want to run it again, it does not work.
I will get an error code with "Automation error The RPC server is
unavailable".
After operating the Reset button (in VBE) I can run the macro again.
I have tried the Reset command in the marco but this did not work.

Can anybody please advice me what I can do to overcome this problem.

With regards Steven


svhell

The RPC Server is unavailable.
 
Sub LoadProjectTOExcel()
Dim FileOpen As String
Dim ProjApp As MSProject.Application

Application.ScreenUpdating = False

Set ProjApp = New MSProject.Application
Wa = ActiveWorkbook.Name

Set Sa = Workbooks(Wa).ActiveSheet
ActiveWindow.FreezePanes = False
On Error GoTo ErrorHandling
FileOpen = Application.GetOpenFilename("Project (*.mpp), *.mpp")
Set ProjApp = New MSProject.Application
With ProjApp
.FileOpen FileOpen 'ProjectToOpen
.Visible = False
End With

'Error occures everytime after this point

MapEdit Name:="Map", Create:=True, OverwriteExisting:=True,
DataCategory:=0, CategoryEnabled:=True, TableName:="Task_Table1",
FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All Tasks",
ImportMethod:=0, HeaderRow:=True, AssignmentData:=True,
TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=False,
TemplateFile:="C:\Program Files\Microsoft
Office\Templates\1033\Microsoft Project Web\Centered Mist Dark.html",
IncludeImage:=False
MapEdit Name:="Map", DataCategory:=0, FieldName:="WBS",
ExternalFieldName:="WBS"
MapEdit Name:="Map", DataCategory:=0, FieldName:="Name",
ExternalFieldName:="Task_Name"

etc.


svhell

The RPC Server is unavailable.
 
I hope that someone can help me with this problem.
I still can not operate the marco more the one time.
After closing the workbook and opening it again it works just ones.

Please help me.

Steven



All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com