Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to determine windows edition

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,044
US
I am looking for a way to determine the windows edition in VBA, for example 2000, XP, Vista or Windows 7. Does anyone know how to do this?

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
A starting point:
MsgBox CreateObject("WScript.Shell").Exec("CMD /C VER").StdOut.ReadAll

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
In Word:

[blue]System.OperatingSystem[/blue] will give you the base sytstem (e.g. Windows NT) and [blue]System.Version[/blue] will give the number (see combo's second link).

In Excel:

[blue]Application.OperatingSystem[/blue] needs a bit of unscrambling but gives the same information.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top