• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting Error "Microsoft Word got an error. Connection is invalid"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Error "Microsoft Word got an error. Connection is invalid"


  • Subject: Re: Getting Error "Microsoft Word got an error. Connection is invalid"
  • From: Geoff Graham <email@hidden>
  • Date: Fri, 21 May 2010 09:40:50 -0400

Well, I think I've told everything I know (which isn't much :). Word (really I script Excel and not Word, but they are similar) is busy doing something when it gets your applescript command, and responds with that generic "Connection is Invalid." It seems that many apps will queue an applescript command if there is something presently going on; I think you get a 30 second timeout window by default; and this spoils us to some degree. Word and Excel seem to be coded to reply immediately, apparently with that error if it's not possible to execute the command at that instant.

Scott had suggested that Word had crashed on you, and that certainly counts as Word being busy and one way you will see this error. I see it often in Excel, and I've been able to work around it by padding my commands with delay 2 and delay 8 and such. I've also had to rearrange blocks of code in scripts (mostly formatting Excel reports, inserting subtotals, etc.) to work around this. My main script I've had to split in two; saving the doc, quitting Excel, reopening and finishing the formatting. I guess that cleared some memory or something, but was one way I worked around these issues.

Just so you know; it's not just you; MS products are often difficult apps to use applescript with.

Geoff

On May 21, 2010, at 6:47 AM, SHIVANK AGGARWAL, Noida wrote:

> Hi Geoff,
>
> I am still facing these issues sometimes . Can you please let me know what else can be done in this case.
>
> Thanks,
> Shivank

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Getting Error "Microsoft Word got an error. Connection is invalid"
      • From: David Garren <email@hidden>
References: 
 >RE: Geeting Error "Microsoft Word got an error. Connection is invalid" (From: Scott Babcock <email@hidden>)
 >RE: Geeting Error "Microsoft Word got an error. Connection is invalid" (From: "SHIVANK AGGARWAL, Noida" <email@hidden>)
 >RE: Getting Error "Microsoft Word got an error. Connection is invalid" (From: "SHIVANK AGGARWAL, Noida" <email@hidden>)

  • Prev by Date: RE: Getting Error "Microsoft Word got an error. Connection is invalid"
  • Next by Date: Демотиваторы
  • Previous by thread: RE: Getting Error "Microsoft Word got an error. Connection is invalid"
  • Next by thread: Re: Getting Error "Microsoft Word got an error. Connection is invalid"
  • Index(es):
    • Date
    • Thread