donmichael
donmichael

Reputation: 68

Excel freeze (but running) after vba SAP script

I have a SAP GUI script in VBA. It starts on buttonclick. On my compture, it works fine. But on other computers, after the script is over, and the macro ends with a msgbox (it says Done) the Excel file is not responding (the script ran fine, saved everything). No error message, moreover it looks like running (in taskmanager).

If more Excel files are open, cannot change between them. VBA editor is the same. However, there are two Excel files:

I looked my SAP settings, Excel settings, but couldn't find any discrepancy. Can anyone help, why is it happening?

Thanks!

Upvotes: 1

Views: 1837

Answers (1)

David Sealey
David Sealey

Reputation: 26

Just been toying with this myself and I just cracked it. In my case I was setting all my objects to nothing but in the wrong order. The reverse order you set them is the key, which is obvious when you think about it.... Hindsight.

Set session = nothing
Set connection = nothing 
Set SapGuiApp = nothing.

Upvotes: 1

Related Questions