Re: Code runs correctly on some computers but not others Follow Up
From: Jonathan West (jwest_at_mvps.org)
Date: 02/15/05
- Next message: Jonathan West: "Re: microsoft word"
- Previous message: Jezebel: "Re: Security of VBA-Projects"
- In reply to: headly: "Re: Code runs correctly on some computers but not others Follow Up"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Feb 2005 11:06:20 -0000
Hi headly,
You should not under any circumstances create an installer that updates
Office DLLs. Two reasons for this. First of all, you may well break the
user's copy of Office if the DLLs are not fully aligned, as they would be if
the copy is updated using a proper Service Pack. Second, you probably would
be in breach of license conditions to redistribute the individual DLLs.
The fact that the bad machine has SP1 installed is not *necessarily* the
cause of the problem. The existence of correlation does not mean that there
is definitely a causal relationship. As far as I can tell, you haven't yet
identified where in the code the hang occurs. Until you do that, you cannot
make more progress on identifying the cause. You will need to produce a
version of the macro that writes its progress to a log file so you can
pinpoint the exact line of code which causes the hang. Unless you do that,
and tell us which line it is, there is little more that anybody here will be
able to do to help.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
"headly" <headly@discussions.microsoft.com> wrote in message
news:FE0096E4-6874-4DCF-B8AC-797948DD4DEE@microsoft.com...
> So I wrote a simple on-exit forms procedure below. It ran fine on Office
> 11,
> but hung on some Office 10 computers. When I saw the setup, I noted that
> the
> problem computer had SP1 (rev 10.37xx) whereas the others did not have SP1
> (rev 10.26xx). The Follow Up Question: If I write a packager/installer in
> Vstudio, isn't it dangerous to overwrite someones dlls? If I write the
> code
> in Office 9, would that avoid the issue? I'd love to know what MSFT thinks
> about this one.
>
> Sub TestEOS()
>
> Dim varFieldResult As Variant
> Dim intTableLine As Integer
>
> On Error Resume Next
>
> Call UnProtectDocument
>
> Application.ScreenUpdating = False
>
> varFieldResult =
> ActiveDocument.Bookmarks("bkmHotelLodgeLine").Range.FormFields.Item("bkmHotelLodgeLine").Result
>
> If varFieldResult = "End of Service" Or varFieldResult = "End of Services"
> Or varFieldResult = "End Of Service" Or varFieldResult = "End Of Services"
> Or
> varFieldResult = "end of service" Or varFieldResult = "End of service" Or
> varFieldResult = "end of services" Or varFieldResult = "End of services"
> Then
> Selection.GoTo What:=wdGoToBookmark, Name:="bkmDatePrepP4"
> End If
>
> 'Housekeeping/Cleanup
> Call ProtectDocument
> Application.ScreenUpdating = True
>
> End Sub
>
> "Jonathan West" wrote:
>
>> In addition to Jay's answer, look at the following
>>
>> - if the macro looks up files in specific locations, are they in the
>> same
>> place on all machines
>>
>> - Are the settings the same in the Options dialog on all machines? For
>> instance, if the Save options include omitting featureslater than Word
>> 97,
>> you will have trouble with nested tables and with text colors
>>
>> The thing to do is to run the code on the various offending machines, and
>> see exactly where it breaks. If you can't go there yourself, produce what
>> I
>> cann an "instrumented" version of your template that writes information
>> to a
>> log file of where it has got to. Get the user to run the program and send
>> back the log.
>>
>>
>> --
>> Regards
>> Jonathan West - Word MVP
>> www.intelligentdocuments.co.uk
>> Please reply to the newsgroup
>>
>>
>> "headly" <headly@discussions.microsoft.com> wrote in message
>> news:EE972256-C0DE-4BF9-BF00-930FE6320530@microsoft.com...
>> > Creating code in Word 03 to run on XP computers. The code runs
>> > flawlessly
>> > on
>> > some machines and errors out on others. Macro security aside, any ideas
>> > why
>> > this would happen? Could it be the machines need service packs?
>> > Coherent
>> > thoughts appreciated. Thx
>>
>>
- Next message: Jonathan West: "Re: microsoft word"
- Previous message: Jezebel: "Re: Security of VBA-Projects"
- In reply to: headly: "Re: Code runs correctly on some computers but not others Follow Up"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|