Jump to content
Sign in to follow this  
TripScott

ObjGet error to MS Word in Win7

Recommended Posts

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

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 - Wiki
OutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

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

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 - Wiki
OutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...