Re: Code runs correctly on some computers but not others Follow Up

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jonathan West (jwest_at_mvps.org)
Date: 02/15/05


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
>>
>> 


Relevant Pages

  • Re: Dll Hell
    ... :>ship with an installer is tame, and it puts usbcalls.dll and ... DLLs are created to share code between applications and to short used ...
    (comp.os.os2.apps)
  • Re: Which version of MSVC?90.DLLs to distribute with Python 2.6 based Py2exe executables?
    ... well as download my program. ... That suggests that you can redistribute the package with your ... application and have your installer run it automatically. ... don't just bindly copy DLLs around. ...
    (comp.lang.python)
  • Re: Internationalization
    ... necessarily the DLLs, but the way in which the assumption about one-DLL-fits-all solution ... security guy wanting to know what this DLL was, and why it had to be in system32 (the ... answer was that it didn't need to be, but it wasn't our installer that installed it, it ... Laermans (a Product Unit Manager at Microsoft) at the last MVP Summit how ...
    (microsoft.public.vc.mfc)
  • Re: Where does word 2003 store list of words ignored during spell ch
    ... If you close Word completely the information is erased, however closing Word ... Word MVP web site http://word.mvps.org ... > BUT this behaviour is not consistently same on all machines. ...
    (microsoft.public.word.docmanagement)
  • Re: Running Batch files from Installer to set Environmental variab
    ... doesn't run without these settings in the environment variables. ... The reason why I'm not 'entirely sure' if it's because of the dlls that I ... That's why I wanted my installer to append the dlls folder location to the ... On uninstallation, path can be restored by overwriting with the value ...
    (microsoft.public.dotnet.languages.csharp)