Monthly Archives: January 2014

Code for Unzipping a Zip File

Following is a VBS function that unzips the given file into the given path : Happy Automating ! Harshit Kohli

Tagged with: , , , , ,
Posted in Code Vault

Code for Maximizing/Minimizing Browsers

There is no Browser.Maximize method in QTP. However, we can use the following workaraound to maximize a browser :- hwnd = Browser(“CreationTime:=0”).Object.HWND    ‘getting the Handle  Window(“hwnd:=” & hwnd).Maximize     ‘Using the maximize method of Window object to maximize

Tagged with: , , , , , , , ,
Posted in Code Vault

What to do when QTP doesn’t Identify Objects ?

QTP is a mysterious tool. Its been around 3 years that I have been investigating this mystery but still I think there’s a long way to go in solving it.So, you are stuck ! irritated with QTP ? Here are

Tagged with: , , , , , , , , , , , , , , , , , ,
Posted in Common Issues

Automating Microsoft Excel Part 2 – Formatting an Excel File

In Automation, Excel files play an indispensable part. Out of the many uses they have, creating reports is one of them. Now when you create a report with the help of an automation script, you would also like to format

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

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

Tagged with: , , , , , , , , , , ,
Posted in MSOffice Automation
Blog Stats
  • 168,300 hits
Categories

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

Join 796 other followers