Setup Menus in Admin Panel

ITeLearn.com

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

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
guest

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
Member
Forum Posts: 3
Member Since:
December 30, 2015
Offline

Hi,

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
FilePath=”C:\UFT_Backup\UFT_Flight\Screenshots\LoginSS.xls”
Set objExcel=CreateObject(“Excel.Application”)
set objFso=CreateObject(“Scripting.FileSystemObject”)
objExcel.Visible=True
If Not objFso.FileExists(FilePath) Then
objExcel.Workbooks.Add
Else
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)
pasteAt.Select
mysheet.Cells(pasteAt, 1).Select ‘This is where picture will be inserted
Dim path1
path1 = Environment(“vSSname”)
Dim p
Set p = objExcel.ActiveWorkbook.ActiveSheet.pictures.insert(path1)’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

objExcel.ActiveWorkbook.Save
Loop
Application.ScreenUpdating = True

Exit Sub

‘ErrNoPhoto:
‘ 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:
11 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Techhelp: 1889

Manu: 114

Shan Nathan: 80

Palanki sai charan: 67

Userone: 59

Vishal Anand: 53

Archana Sapre: 51

Geetha Reddy: 44

useL: 38

Priyanka Perumalla: 36

Member Stats:

Guest Posters: 19

Members: 7846

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 22

Topics: 2065

Posts: 5698

Newest Members: Syed Gillani, Naga Venkata Yerramsetti, Amulya Rajendran, kiran pujar, Anupama Odnala, Hitesh Shah, Jaya Vysyaraju, Md Payel Miah, Ashwini Yerra, Jennifer Manual

Administrators: Karthik eLearn (Admin): 49

0 Responses on Discussions"

Main Menu