Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Check Running Applications on the client PC using ABAP

former_member198406
Contributor

I am developing a program with OLE2OBJECT for processing the MS word file. But, The system sometimes process already opened word file instead of the desired file. So, I want to check in the beginning of my program, if MS word is already running or not. How can I check this.

Regards,

Dipeshkumar Bhavsar

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

Usually solved with method get 'GetObject' on 'Word.Application' , if assign successfull (and '.Documents.count.' > 0) then Word is already running (with at least one opened document) else use 'CreateObject'. (But usually in some VBscript, CL_GUI_FRONTEND_SERVICES=>EXECUTE, etc.)


0 Kudos

Hi Raymond,

Thanks for your answer. But, I am struggling to get the value back in SAP for Documents.Count. If you can help me how to get the value back in SAP.

Regards,

Dipeshkumar Bhavsar

0 Kudos

In vba, code would look like

    Dim wdApp As Object
    Set wdApp = GetObject(, "Word.Application")
    Debug.Print wdApp.Documents.Count
    Set wdApp = Nothing

0 Kudos

I know the VBA Code. But, how to replicate the same in SAP? This GetObject is a function not the method or property. so, it is hard to call within the ABAP code.