Error running GetVersionExA

F

FatP

I have a VBA program which uses the WIN32API GetVersionExA:

Private Declare Function GetVersionEx Lib "kernel32" _
Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As
Boolean

....

Dim theOsVersionInfo As OSVERSIONINFO
theOsVersionInfo.dwOSVersionInfoSize = 148

If GetVersionEx(theOsVersionInfo) Then
...
else
...
end if


When windows is started in Normal mode, the If statement flows into
the else block. And all the fields in theOsVersionInfo have initial
values.

It works when windows is started in Safe mode.

Windows Version: XP SP2, with most hotfix applied
Excel version: 2003 SP2

Any suggestion? Thanks
 

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