Setup Menus in Admin Panel

Adding multiple screenshots in excel sheet using UFT | QTP Automation | Discussions |

Forum usage guidelines

  1. Search First.: If you don’t find a similar post, start a new topic. If you find a similar thread and still have a question, reply to that topic. Duplicate threads will be ignored/deleted without warning.
  2. Proper Subject: Ensure you choose a very appropriate topic name. Else it will be tough to get support from other members.
  3. Patience, please: Our Tech team or other members will usually try to respond within 24 hours on weekdays and max within 48 hours on weekends. Sometimes sooner.
  4. Share opinions: Please feel free to reply, add or comment on any ongoing topics. Collective learning will be of great benefit to all.

ITeLearn reviews from participants.

Please consider registering

Log In

Lost password?
Advanced Search

— Forum Scope —


— Match —


— Forum Options —


Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Adding multiple screenshots in excel sheet using UFT
March 4, 2017
12:22 am
Amey sangle
Forum Posts: 3
Member Since:
December 30, 2015


I have a function called Addscreesnhot which takes screenshots where ever needed.Aftre this I call AddPicture which insert pictures in excel sheet one below other.i need to attach screenshot after each call of Addscreenshot function.I am able to attach all screenshots at same place in excel sheet as I am not able to move in excel sheet.
Below is the code for AddPicture() Procedure.

Kindly advice

Public Sub AddPicture()
Dim picname As String
Dim pasteAt
Dim lThisRow
pasteAt = CInt(pasteAt)
lThisRow = CLng(lThisRow)
Dim count
Environment(“vThisRow”) = “27”
lThisRow = 2 + Clng(Environment(“vThisRow”))
Dim objExcel, FilePath
Set objExcel=CreateObject(“Excel.Application”)
set objFso=CreateObject(“Scripting.FileSystemObject”)
If Not objFso.FileExists(FilePath) Then
set myFile= objExcel.Workbooks.Open (FilePath)
Set mySheet=myFile.Worksheets(“Sheet1”)
path = “C:\UFT_Backup\UFT_Flight\Screenshots\260217003509.png”
End If
mysheet.Cells(lThisRow,3) = Environment(“vTC”)
Do While (mysheet.Cells(lThisRow, 3) “”)
mysheet.Cells(lThisRow,3) = Environment(“vTC”)
Set pasteAt = mysheet.Cells(lThisRow+1, 3)
mysheet.Cells(pasteAt, 1).Select ‘This is where picture will be inserted
Dim path1
path1 = Environment(“vSSname”)
Dim p
Set p =’Select ‘Path to where pictures are stored

‘ ”””””””””””””””””””””””””””’
‘ ‘ This resizes the picture
‘ ”””””””””””””””””””””””””””’
With p

.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.Height = 300
.ShapeRange.Width = 500
.ShapeRange.Rotation = 0
End With

‘ lThisRow = lThisRow + 1

Application.ScreenUpdating = True

Exit Sub

‘ MsgBox “Unable to Find Photo” ‘Shows message box if picture not found
‘ Exit Sub
‘ Range(“B20”).Select

‘End Sub

Forum Timezone: UTC -8

Most Users Ever Online: 70

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Techhelp: 1940

Manu: 114

Shan Nathan: 80

Palanki sai charan: 67

Userone: 59

Vishal Anand: 53

Archana Sapre: 51

Geetha Reddy: 44

useL: 38

Kavya Vangala: 37

Member Stats:

Guest Posters: 19

Members: 8066

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 22

Topics: 2124

Posts: 5829

Newest Members: Enterprise HoldingsInc, Devasish kar, Anupama Sood, Thrilok Thrilok, HARISH PUTTA, Immanuel Michealraj, Sarvani Uppati, vikas shinde, Jignesh Patel, Swathi Swathi

Administrators: Karthik eLearn (Admin): 49

0 Responses on Discussions"

Main Menu