+ Reply to Thread
Results 1 to 6 of 6

clicking a button on a promt box VBA

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    clicking a button on a promt box VBA

    Hey,

    I have VBA code written to run solver with various scenarios. each time a scenario runs solver promts a promt box. I need to hit ok everytime for it. the code takes a while to run, so i would like to have a piece of code which does this for me so i can continue on other work. I have tried using application send keys, however it is not the most efficient and it doesnt always work :s Is there a better method?

    thanks,

  2. #2
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: clicking a button on a promt box VBA

    I have also tried

    docmd.select.ok but it doesnt work. does anyone have an idea?

  3. #3
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: clicking a button on a promt box VBA

    so i was working on adding apart to my event. and when im running the loop for some reason the sendkeys application works for promt except the first one:S i really didnt think send keys would work, as it didnt seem like the proper application. any better ideas?

    Please Login or Register  to view this content.
    I have that sendkeys application after my solver code

    Please Login or Register  to view this content.
    Last edited by mike02; 08-03-2012 at 10:02 AM. Reason: add my code

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,710

    Re: clicking a button on a promt box VBA

    Did you try?
    Please Login or Register  to view this content.
    Alf

  5. #5
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: clicking a button on a promt box VBA

    yes I did. sry i forgot to mention that. for some reason the dialog box still promts with that. there has to be a way. Send keys works for all of them but the first one. but i dont inderstand since i have it on a loop. It doesnt make any sense

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,710

    Re: clicking a button on a promt box VBA

    Strange as this works fine in this microsoft example for solver in a loop:

    Please Login or Register  to view this content.
    Perhaps you could upload a sample workbook with your macro?

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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