Invoke code throw error

I am getting error while run code in invoke code activity

var wordApplication = new Microsoft.Office.Interop.Word.Application() { Visible = false };
var myDocument = wordApplication.Documents.Open(in_FilePath);
var sh = myDocument.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 10, 10, 110, 20);
sh.TextFrame.TextRange.Text = “RPA 10 10”;
sh.TextFrame.MarginLeft = 0; sh.TextFrame.MarginRight = 0; sh.TextFrame.MarginTop = 0; sh.TextFrame.MarginBottom = 0;
myDocument.Save();
wordApplication.Quit();

This is exactly the same issue you have with excel application in this topic:

You have also problem with communication with Word application.
Try to use this repair tool:

I suppose you have excel and word installed :slight_smile: