Skip to content

Instantly share code, notes, and snippets.

View sagarlolla's full-sized avatar

Sagar Lolla sagarlolla

  • Eagan, Minnesota
View GitHub Profile
'Retrieve username from windows login session
objUserName= CreateObject("WScript.Network").UserName
'Retrieve password from Environment variable 'AUTPwd'
objPassword= CreateObject("WScript.Shell").Environment("USER").Item("AUTPwd")
'Set the username on AUT
Browser("").Page("").WebEdit("username").Set objUserName
'Set the password on AUT
Browser("").Page("").WebEdit("password").SetSecure objPassword
'Click on login button
Browser("").Page("").WebButton("Login").Click
Set wshShell = CreateObject( "WScript.Shell" )
Set wshUserEnv = wshShell.Environment( "USER" )
wshUserEnv("AUTPwd") = "**********"
Set wshUserEnv = Nothing
Set wshShell = Nothing
@sagarlolla
sagarlolla / ExcelOperations.vbs
Created September 24, 2016 04:25
Create Excel, Open Excel, Write data in it, Read values, Search for a value
Dim objExcel
Dim objWorkBook
Dim objWorkSheet
Dim intRow
Dim intCol
Dim strPath : strPath ="D:\EmpData.xlsx"
'Create a new excel file under a given path
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add
@sagarlolla
sagarlolla / ExcelAsDataBase.vbs
Last active May 9, 2017 18:38
Query excel as database and read values
Dim objExConn
Dim objRecSet
Dim strPath
Dim strSQL
Dim strConnString
Dim intColCount
strPath = "D:\Datasheet.xlsx"
'Create an ADODB connection
@sagarlolla
sagarlolla / DictonaryDemo.vbs
Last active August 30, 2016 04:29
Dictionary Example
Dim dicStudentsList
Dim arrItems
Dim arrKeys
'Creating a dictionary object
Set dicStudentsList =CreateObject("Scripting.Dictionary")
'Adding Key-Item values to dictionary
dicStudentsList.Add "17861","Peter"
dicStudentsList.Add "17862","Bob"