TripScott 0 Posted April 6, 2011 Hello. I have a script that runs a MS Word macro. It has worked for over a year just fine in Word 2007 (*32) under Windows XP x32. My company is upgrading everyone to Windows 7 (x64). I cannot get AutoIt to get the Word 2007 (*32) object so the macro runs. I receive this error: "--> Word.au3 Error from function _WordMacroRun, $_WordStatus_InvalidDataType." $oWordApp = ObjGet("", "Word.Application") $oWordDoc = ObjName("", "Word.Application.Documents") WinWait("[REGEXPTITLE:^.* - Microsoft Word$]", "") If Not WinActive("[REGEXPTITLE:^.* - Microsoft Word$]", "") Then WinActivate("[REGEXPTITLE:^.* - Microsoft Word$]", "") WinWaitActive("[REGEXPTITLE:^.* - Microsoft Word$]", "") $oWordDoc = WinActivate("[REGEXPTITLE:^.* - Microsoft Word$]", "") _WordMacroRun($oWordApp, "pMassLoadFromPIM") I have recompiled the script to UseX64=y. I also tried UseX64=n, which didn't work either. What is different in Windows 7 x64 that would cause this script to not work when it works in Windows XP X32? Interestingly enough the ObjGet does work for Excel and I am able to read and write to the spreadsheet. Thanks for any help. My team is counting on me. Kristine Share this post Link to post Share on other sites
big_daddy 20 Posted April 6, 2011 Try running the code in SciTE with the following at the top of your script. #AutoIt3Wrapper_UseX64 = n It would also help if you add the following toward the top of your script before using any _Word* functions. _WordErrorHandlerRegister() Share this post Link to post Share on other sites
gigi1 0 Posted April 7, 2011 also you can try with _WordAttach instead of ObjGet Share this post Link to post Share on other sites
water 2,392 Posted April 7, 2011 I had a similar problem: OS was Windows 7 64 bit, Office 2010 was 32 bit, the AutoIt script was compiled for 64 bit. As soon as I compiled the AutoIt script for 32 bit everything was working fine again. A 32 bit COM doesn't work well with a 64 bit application. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
TripScott 0 Posted April 7, 2011 I had a similar problem: OS was Windows 7 64 bit, Office 2010 was 32 bit, the AutoIt script was compiled for 64 bit. As soon as I compiled the AutoIt script for 32 bit everything was working fine again.A 32 bit COM doesn't work well with a 64 bit application.That was it exactly!! Thank you very much! I was recompiling all my scripts in W7x64 because some of them would fail when I tried to run them. But those weren't the Word scripts. This leads me to a compile question. Is there a difference (for execution purposes) between compiling on an XP x32 machine in x32 mode and W7x64 in x32 mode? Kristine Share this post Link to post Share on other sites
water 2,392 Posted April 7, 2011 I moved 32 bit executables from XP to Windows 7 and they just ran fine. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites