Complex sentence: Until he first met Sharpe his schemes were largely successful and he is well regarded by his Imperial Master who entrusted him with matters of great importance, posting him to Spain to resolve what Napoleon described as the "Spanish Ulcer".
Split into simpler sentences: Until he first met Sharpe his schemes were largely successful and he is well regarded by his Imperial Master who entrusted him with matters of great importance. Hence his posting to Spain, to help sort out what Napoleon described as the "Spanish Ulcer".