Ok by looking at it, it must be because I never set wd.
How can I word it to set wd active document?