ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error running GetVersionExA (https://www.excelbanter.com/excel-programming/400397-error-running-getversionexa.html)

FatP

Error running GetVersionExA
 
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



All times are GMT +1. The time now is 01:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com