What did Yosef mean when he said, "Atem Chashavtem Alai l'Ra'ah; Elokim Chashavah l'Tovah!"?
Rashbam: Although you intended to do me harm, Hashem caused you not to sin against me, because He wanted things to turn out for your good.
Seforno, Ha'amek Davar: You acted in error, thinking that I was a Rodef (who was after your blood), in which case what you did would have been justified. Ha'Kadosh-Baruch-Hu caused you to err for a good purpose. Ha'amek Davar - Therefore, also suspecting me was not a sin.
Ohr ha'Chayim: This is like one who wanted to give to his colleague to drink a cup of death, and he gave to him a cup of wine. He is not liable at all. They are exempt also bi'Yedei Shamayim.
Malbim: I cannot punish you according to the evil that you did to me, for you intended for me such an evil that Hashem intended it for good. Can I pay to you such an evil that Hashem intends it for good? Am I in place of Hashem?!
Why is "Aso" written with a Hei?
Hadar Zekenim (to 45:12): This hints that Hashem did this, and not me.
Why did he say "l'Hachayos Am Rav"?
Malbim: Hashem would not do wonders like this for an individual, only for a Rabim. How can I do opposite to Hashem's desire?!