SAP: Copy SAP message to Excel Column

81 Views Asked by At

I am not sure what I missed here, I am really new to VB and I would appreciate your time to help me on this. I want to copy message that showing at the corner of SAP to specific column at the same line that it run, and I got error 91 which little confuse. If I remove that line, everything working fine.

Here is part of the code I use

Dim objSheet As Excel.Worksheet
..
.
.
LastRow = ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, 1)End(xlUp).Row
.
For i = 2 To LastRow
objSheet.Cells(i,5).Value = Session.FindByID("wnd[0]/sbar/").Text 'I want the message showing in Cloumn E and them same row it running 

enter image description here

0

There are 0 best solutions below