The RPC Server is unavailable.

S

svhell

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
 
S

svhell

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.
 
S

svhell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top