Hello,
I'm currently trying to write a script that will run the KSB1 transaction in SAP and download the output to a specific location. The problem is when the Save As Dialog box come up. Since that dialog box is generated by Windows, the SAP GUI scripting doesn't record it. Newer version of SAP has a solution for this, but unfortunately, I'm running an old one. I can get VBA to get to the point of opening up the dialogue box but I can't get it to fill in the filename and then hit save.
I've tried many things from sap archive, but the solutions of Script Man or Holger Kohn don't seem to work for me. I'm talking about those threads :
https://archive.sap.com/discussions/thread/3890879
https://archive.sap.com/discussions/thread/1487670
Holger Kohn's solution:
This solution of Holger Kohn actually works when the dialog is already there and I then start a new VBA procedure. The problem is that when VBA opens the Save As dialog box, it will stop executing the code as long as the user doesn't click on a location to save the file or presses cancel. So I can't make VBA call the "Auto_SaveAs_SAP" macro. What he suggested to someone else is to loop from another instance of Excel. I'm not sure what he means by that because you can't run to macros at the same time, unless it's from a separate computer altogether which me or another user running the report won't have access to.
If I'm missing something here, please let me know.
Here is Script Man's solution. In VBA:
In VBS:
I've tried many different instances of this and all it does is open the VBS file without actually doing anything else.
I'm kind of desperate now... Please help!
Note: Cross-post: https://www.mrexcel.com/forum/excel-...x-vba-vbs.html
Bookmarks