Syntactically, you have essentially this (depending which revision of the post we're looking at):
Object.Property = Object.Method(arguments).Property"some stray string literal", "another string literal"
^ end of statement expected here
While this is a legal statement:
Object.Property = Object.Method(arguments).Property
Either remove the stray string literal, or make it part of the arguments to the findById
method - I don't know the SAP API, but since you're coding against it you should have access to some documentation explaining what the expected arguments are.
This code will compile - again I have no idea what the SAP API wants to see, so it might blow up at run-time, but at least it's legal code:
ActiveSheet.Cells(LINHA, 2).Value = session.findById("wnd[0]/usr/shell/shellcont[1]/shell[1]", 2, "&Hierarchy").Text