cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get the line of error with vba in sap

hello, i have recently started to use vba in excel with sap. When im using the fmbb transaction in sap sometimes im getting a error. The error is always displayed in the error log. When i press right click on the error and press details i can see the line where the error is occurring. My question is how im getting the line of the error out of there with vba. Ive tried to use script records unsuccessfully. Thanks for the help.

Accepted Solutions (0)

Answers (1)

Answers (1)

dustin_theophil
Explorer
0 Kudos

I don't know the transaction, but if you mean the message that you get on the bottom left corner after executing, you can access this with:

Dim objSBar As GuiStatusbar

Set objSBar = session.FindById("wnd[0]/sbar")

Range("A1").Value = objSBar.Text
Range("B1").Value = objSBar.MessageId
Range("C1").Value = objSBar.MessageType
Range("D1").Value = objSBar.MessageNumber
Range("E1").Value = objSBar.Name