I think it is because you are trying to run an actual VBA macro that is the problem.
I was however able to get the same functionality as a macro directly from AHK using COM, and this ran even when I was logged off.
Try the following example (requires
COM Standard Library):
Code:
FileName := "c:\test.doc"
TestText := "test text 123"
COM_Init()
oWord := COM_CreateObject("Word.Application") ; create word object
COM_Invoke(oWord, "Visible=", False) ; make sure it's not visible
COM_Invoke(oWord, "Documents.Add") ; add a document
COM_Invoke(oWord, "Selection.TypeText", TestText) ; add some text
COM_Invoke(oWord, "ActiveDocument.SaveAs", FileName, 0) ; save the document
COM_Invoke(oWord, "Quit") ; close word
COM_Release(oWord) ; tidy up
COM_Term()
This should create a test file at c:\test.doc with some text in it if you trigger it via Scheduled Tasks, even if you are logged off (worked for me anyway).
See the below link for more info on how to automate Word (and other office apps) - see if you can get the functionality of your macros ported directly over to AHK and this should then mean it (hopefully) works:
MS Office Automation Functions (via COM) [thanks Sean]