Re: Getting Error "Microsoft Word got an error. Connection is invalid"
Re: Getting Error "Microsoft Word got an error. Connection is invalid"
- Subject: Re: Getting Error "Microsoft Word got an error. Connection is invalid"
- From: David Garren <email@hidden>
- Date: Fri, 21 May 2010 10:06:38 -0500
- Thread-topic: Getting Error "Microsoft Word got an error. Connection is invalid"
Geoff is right.
We have 3 Excell applescripts running everyday, 7 days a week.
I have learned the hard way what Geoff is saying.
I have had to re-arrange blocks of code for script 2 that do not work in
script 1 even though they are both Excell
As far as saving an excell file I first (and it always fails on me) try to
save the document then trap that error and the address the work book itself.
Then saving the active workbook after those two fail in that order.
Then delay 5 then save again. AFTER bringing excell to the front :).
It sounds crazy BUT the current code has worked flawless for the past six
months.
Thanks
David
On 5/21/10 8:40 AM, "Geoff Graham" <email@hidden> wrote:
> 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
_______________________________________________
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