How to Find MS Office version with QTP/VBS ?

The following code can be used to find out the office version :-

Dim regEntryOffice

regEntryOffice =”HKEY_CLASSES_ROOT\Excel.Application\CurVer\”

If WshShell.RegRead (regEntryOffice)=”Excel.Application.12″ Then
Environment.Value(“OfficeVersion”)=”2007″
Elseif WshShell.RegRead (regEntryOffice)=”Excel.Application.14″ Then
Environment.Value(“OfficeVersion”)=”2010″
Elseif WshShell.RegRead (regEntryOffice)=”Excel.Application.15″ Then
Environment.Value(“OfficeVersion”)=”2013″
End If

Happy Automating !

Harshit Kohli

Advertisements

Eat, Sleep, Automate. REPEAT !

Tagged with: , , , , , , , , , , ,
Posted in MSOffice Automation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Stats
  • 168,130 hits
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 796 other followers

%d bloggers like this: