cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Macro screen update

marc_marco
Contributor

Hello,

I'm using the above approach to connect to SAP in order to upload data from excel to SAP R/3 transaction.

Myquestions is there exist away to prevent the screen flickering from EXCEL to SAP during the macro processing , tried to the statement at the excel macro : Application.ScreenUpdating =FALSE which didn't worked.

In other words my requirement is not see SAP screen at all during the macro processing.

If Not IsObject(SAPguiApp) Then

Set SAPguiApp = CreateObject("Sapgui.ScriptingCtrl.1")

End If

If Not IsObject(Connection) Then

Set Connection = SAPguiApp.OpenConnection("SYSTEM", True)

End If

If Not IsObject(Session) Then

Set Session = Connection.Children(0)

End If

Session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "CLIENT"

Session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "USER"

Session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "PASSWORD"

Session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"

Session.findById("wnd[0]/usr/txtRSYST-LANGU").SetFocus

Session.findById("wnd[0]/usr/txtRSYST-LANGU").caretPosition = 2

Session.findById("wnd[0]").sendVKey 0

'Here follows the recorded VBScript . . .

Regards,

Mark

Accepted Solutions (1)

Accepted Solutions (1)

script_man
Active Contributor
0 Kudos

Hi Mark, welcome to the forum.

I'd test it with session.findById("wnd [0]"). iconify.

And I would eliminate the command session.findById("wnd [0]").maximize.

Regards,

ScriptMan

Answers (1)

Answers (1)

marc_marco
Contributor
0 Kudos

Scriptman Thank you , problem resolved.

Regards,

Mark