Take various screenshot using macro and save in disk

B

Boss

Hi,

I have always received best support from this community... THANKS!

I am not sure is this the right place to ask the question, but i caanot stop
myself as its very important for me...

I have a excel code which starts an external application and pulldata from
the external application and pastes it in the excel sheet.

Please look at the code below and help me know that, can i take screenshot
of the screens of external application and save them in hard disk.

Public myobj As Object

Sub MyLogOn()
Set myobj = CreateObject("BPGUMAS.UMAS")
With myobj
.Logon ("C:\Accessw\accessw.exe ssbhost.acw")
If .GETERRMSG <> "" Then
MsgBox .GETERRMSG
.LogOff
Set myobj = Nothing
End
End If
End With
End Sub
Sub MyLogOff()
With myobj
' .LogOff
If .GETERRMSG <> "" Then
MsgBox .GETERRMSG
Else
MsgBox "Logoff was Successful"
End If
End With
Set myobj = Nothing
End Sub

Sub GetFactor()
Dim i As Integer, strTemp As String
MyLogOn

i = 1
'Sheets("factors").Range("B5:E1000").ClearContents
With myobj
Do

.FUNC = "BGOV"
.BGOV.cusip = Range("cusip").Offset(i, 1)

..Browse
strTemp = .GetScreen(1)

data_one = Trim(Mid(strTemp, 82 + 10, 8))
data_two = Trim(Mid(strTemp, 91 + 10, 15))
data_three = Trim(Mid(strTemp, 322 + 10, 8))
data_four = Trim(Mid(strTemp, 331 + 10, 15))
data_five = Trim(Mid(strTemp, 562 + 10, 8))
data_six = Trim(Mid(strTemp, 571 + 10, 15))
data_seven = Trim(Mid(strTemp, 802 + 10, 8))
data_eight = Trim(Mid(strTemp, 811 + 10, 15))



Range("cusip").Offset(i, 2) = data_one
Range("cusip").Offset(i, 3) = data_two
Range("cusip").Offset(i, 4) = data_three
Range("cusip").Offset(i, 5) = data_four
Range("cusip").Offset(i, 6) = data_five
Range("cusip").Offset(i, 7) = data_six
Range("cusip").Offset(i, 8) = data_seven
Range("cusip").Offset(i, 9) = data_eight



i = i + 1
Loop Until Range("cusip").Offset(i, 0) = ""
End With
MsgBox ("Done")
End Sub

Thanks!
Boss
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top