I've found a more robust approach. It
a) does not require that X be interior to the triangle.
b) avoids dividing by lenghts (a.k.a round off error)

It utilizes the cross-product and uses Solver to find the Z, such that Q3 • (Q1 X Q2) = 0

If the Button doesn't work, Solver can be called manualy or the Solver Add-in should be active in the VBE Tools>References.