Cable beetwen two component

Hello, i want to use the cable component to make a cable beetween two different component.
When i write the name of the component into “attach end to” this dont work, how to do this ? Thanks