application.version delivers wrong result on xp

K

kopinsky

Hello,
our visual basic 6 application uses word to create reports. At the start of
the appplication we check the version of the installed word-application by
creating a word-object and calling:

application.version

If the result is less then 9.0 the application doesn´t start, because Word
97 and earlier is not supported. And this works fine for 7 years now.

Since a couple of days one of our customers has the effect that our
application doesn´t start because the word-version is supposed to be too old.
They use Word 2003 on windows 2000 and windows xp. On computers with windows
2000 it still works, on ALL computers with xp it doesn´t. When i start word
on one of those computers and call the above function within word, it get
11.0 as the expected result.
The only changes on those computers recently where windows updates. They
have tried to reinstall office 2003, but it didn´t help.

What can be the reason for this? Is there anything else i can check?
Unfortunately out customer is not able to determine which windows updates
have been installed on those computers recently.

Any help is much appreciated. If there is anymore information i can give
you, please ask.

Regards
Christoph
 
C

Chirag

How are you comparing the return value of Application.Version?
Application.Version returns a string value. You need to convert that to a
double and compare as a double-type value.

Another point to check is the locale in which your VB6 application is
running and that locale's representation of a decimal separator.
Application.Version always uses a dot (.) for a decimal separator even in
locales that use a different character for decimal separator. The Val()
function expects the locale's decimal separator for a decimal number. For
example, it would be expecting a 11,0 instead of 11.0 in some locales. This
causes issues when you use Val() for converting from string to double since
Application.Version will be returning 11.0 and not 11,0 in those locales.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
K

kopinsky

Thanks for your reply. Converting the string result to a double is exactly
what i do. Sorry that i forgot to mention that.

How can it have happened that the locale of my vb-application has been
changed and where can i check in what locale it is currently running. The
programm is running on those computers for years and the customer says that
he has not changed anything.

What you suggest sounds possible, but shouldn´t the conversion from string
to double fail with an error?

Thanks for your help
Christoph
 
C

Chirag

Yes, the conversion from string to double should fail. If you use On Error
Resume Next, you would have effectively ignored the error and the value in
your variable would be 0 perhaps. If that value gets compared with 9.0, you
would get your "result is less than 9" situation.

The locale for VB6 would be the same as that of Windows user locale. Check
the user's regional settings.

All this is shooting in the dark though.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
K

kopinsky

A shot in the dark is better than nothing. I let my costumer check the
regional settings. I´ll let you know about the result.

Any more ideas anyone?

Thanks for your help.
Christoph
 
K

Karl E. Peterson

kopinsky said:
A shot in the dark is better than nothing. I let my costumer check the
regional settings. I´ll let you know about the result.

Here's a class module you can use to pull up any regional information you may need:

http://vb.mvps.org/samples/Locale
Any more ideas anyone?

Post yer code. Something obvious may stick right out. Barring that, create a very
simple little demo app that takes diagnostic readings (like the Application.Version
string), combines them into a string which is put on the clipboard, and ask your
customer to paste this information into an email to you. In a word: troubleshoot.
 
K

kopinsky

Hello again,

I have found out that the problem was that no application-object could be
created, so the automation of word was not working on the xp-machines of my
customer.

After a long research, we have found out that the reason for this was the
windows update KB959426 which is a security update for windows xp and which
has been installed last week. After removing this patch everything is working
fine again.

Problem solved i would say, but my customer is not happy of course that
there now is a "critical windows update" not installed on his machines. So
here comes my question: does anybody know, what this update does and why it
could interfere with the automation of word 2003? Is there a patch for the
patch?

Any help is much appreciated
Christoph
 
S

Steve Rindsberg

After a long research, we have found out that the reason for this was the
windows update KB959426 which is a security update for windows xp and which
has been installed last week. After removing this patch everything is working
fine again.

Problem solved i would say, but my customer is not happy of course that
there now is a "critical windows update" not installed on his machines. So
here comes my question: does anybody know, what this update does and why it
could interfere with the automation of word 2003? Is there a patch for the
patch?

If nobody comes up with a direct answer, Google this for a raft of hits:

site:microsoft.com KB959426
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top