preload

How to find-replace empty cells (Excel, QTP, VBScript)

Posted by Albert Gareev on Jan 29, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Open worksheet – Loop through data range – close and save the workbook. Note.  In the example below script finds empty cells and assigns zero  to them. Make sure you targeted the worksheet that you need. You can find it […] ...

How to find Excel worksheet by name (QTP, VBScript)

Posted by Albert Gareev on Jan 27, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Loop through worksheets – close and save the workbook. 1. If you know Excel Worksheet name and pretty sure it exists 2. If you don’t know Excel Worksheet name exactly or not sure if it exists ...

How to check if folder exists (QTP, VBScript)

Posted by Albert Gareev on Jan 24, 2010
1
Parent page: Service Functions – System (QTP, VBScript) Use FileSystemObject.FolderExists method. Argument should be a full path string.   When to use it? Always before trying to access the folder (delete, rename, or read from) or create files in it. Note. Always release the object you created when you no longer need it. If you don’t do […] ...

How to add (create) Excel macro from QTP

Posted by Albert Gareev on Jan 21, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Retrieve Code Module object – Add new macro string – close and save the workbook. Notes. For this example let’s assume our target Workbook is stored as “C:\Temp\1.xls”, and our target Code Module is named “Module1”. QTP/VBScript source code ...

How to enlist Excel VBA macros (QTP, VBScript)

Posted by Albert Gareev on Jan 20, 2010
1
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Retrieve Code Module object – Retrieve Code Block string – Parse the string – close and save the workbook. Notes. For this example let’s assume our target Workbook is stored as “C:\Temp\1.xls”, and our target Code Module is named “Module1”, and ...

How to exchange parameters with Excel VBA function ...

Posted by Albert Gareev on Jan 15, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers 1. To pass-in parameters to an Excel VBA function A function must be public and belong to a Macro Module. QTP/VBScript source code Excel/VBA function source code 2. To retrieve parameters from an Excel VBA function You need to reserve cells on a worksheet for that purpose. […] ...

How to call Excel VBA function from QTP

Posted by Albert Gareev on Jan 14, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Invoke the function – Catch error – close and save the workbook. Notes. Macro (Sub or Function) must be public and belong to a Macro Module. ...

Service Functions – Excel (QTP, TestComplete, ...

Posted by Albert Gareev on Jan 12, 2010
0
In the code examples I present I often refer to routine functions. In my framework I have specialized libraries to call from.  In my blog I maintain the similar structure. Functions Excel File Worksheet compare (QTP, VBScript) How to check if Excel Workbook is locked A little automation for VBScript OOP (1) A little automation for […] ...

Independent hosting

Posted by Albert Gareev on Jan 10, 2010
0
This one is to announce that Automation Beyond blog has moved to an independent web hosting service. Maintenance works ahead. ...
Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.