+ Reply to Thread
Results 1 to 9 of 9

prevent msgbox stops running macro

  1. #1
    Forum Contributor
    Join Date
    03-28-2017
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    241

    prevent msgbox stops running macro

    Hi

    I have a workbook that every 10 min update some api data.
    I have a few macros running that handel that data (also sceduled on time)
    1 macro that run every hour, has also a line that let the workbook save (backup)

    The problem now is that if he want to save at the moment an api update is running, a msgbox appears that say " this action wil ends the current update, ok/cancel.
    A msgbox put everything on stop ... macros not go on .. so if it is night or I am not there.. my whole system stops ..

    is there a way to auto answer this msgbox "cancel" ..
    or is there a way to prevent api update starts before this macro is finished ?

    Thanks
    Chris

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: prevent msgbox stops running macro

    1. Try this
    BEFORE the line which causes the message to appear
    Please Login or Register  to view this content.
    AFTER
    Please Login or Register  to view this content.

    2. If you call the API update from within the macro, it would give you control over the timing of the update. The file save and API update should not conflict if you do that.

    You may need to introduce a delay to allow the update to complete - this delays things by 10 seconds
    Please Login or Register  to view this content.
    Last edited by kev_; 10-19-2017 at 02:18 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Contributor
    Join Date
    03-28-2017
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    241

    Re: prevent msgbox stops running macro

    Thanks kev !

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: prevent msgbox stops running macro

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-28-2017
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    241

    Re: prevent msgbox stops running macro

    Kev, can you explain me short how i can move the api update (wich I do direct in the table now (right click)) into my macro ?

    thanks

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: prevent msgbox stops running macro

    Set updates to manual:
    Data \ Connections \ Refresh every check box shouild not be checked

    Add one of the lines in post#4 to your VBA

  7. #7
    Forum Contributor
    Join Date
    03-28-2017
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    241

    Re: prevent msgbox stops running macro

    ok, thanks, I try it out and let you know (maybe tomorrow)

  8. #8
    Forum Contributor
    Join Date
    03-28-2017
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    241

    Re: prevent msgbox stops running macro

    Hi Kev,

    something came in between, but tested your solution now and it is perfect ! Have to select out the 3 checkboxex at the table property = also allw background update.

    thanks
    Chris

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: prevent msgbox stops running macro

    Thanks for added reps
    Please click Thread Tools at top of thread and mark thread as SOLVED

+ 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. Macro stops without running rest of code
    By ajm1991 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-19-2016, 05:50 PM
  2. [SOLVED] How to prevent worksheet code from running while Module Macro is running:
    By Chad Bateman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2015, 09:26 AM
  3. Macro Stops Running
    By bhbjk1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2015, 08:22 PM
  4. [SOLVED] 'True' message box and macro stops running
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2014, 09:43 AM
  5. [SOLVED] Macro Stops running after paste values
    By mhawkins91 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-12-2014, 05:23 PM
  6. Protection Stops Macro From Running
    By Keith Burgess in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-11-2008, 07:15 AM
  7. [SOLVED] Macro stops running after file has moved
    By LWhite in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2005, 04:06 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