+ Reply to Thread
Results 1 to 2 of 2

SAP - Deal with the "Save As" dialog box with VBA and/or VBS

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    79

    SAP - Deal with the "Save As" dialog box with VBA and/or VBS

    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:

    Please Login or Register  to view this content.
    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:

    Please Login or Register  to view this content.
    In VBS:

    Please Login or Register  to view this content.
    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
    Last edited by YounesB3; 08-11-2017 at 11:43 AM. Reason: Links update

  2. #2
    Registered User
    Join Date
    09-05-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: SAP - Deal with the "Save As" dialog box with VBA and/or VBS

    Hello, I finished my code. Everything works except for this. Any help would be appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Automate "Save" from IE11 "View Downloads" dialog
    By fyongyu09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2017, 03:03 AM
  2. Replies: 1
    Last Post: 03-09-2016, 12:17 PM
  3. Replies: 4
    Last Post: 04-05-2014, 08:53 AM
  4. Force "Save As" dialog to default to a specific directory?
    By devolve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2011, 03:37 AM
  5. Close file without "Save Changes" dialog box?
    By HBF in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2009, 11:28 AM
  6. Excel "Save as" dialog - when file already exists
    By MattM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2006, 08:50 AM
  7. Replies: 4
    Last Post: 12-08-2005, 01:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1