+ Reply to Thread
Results 1 to 7 of 7

Issue with Macro Stopping, need help

  1. #1
    Registered User
    Join Date
    07-11-2018
    Location
    Florida
    MS-Off Ver
    Office 16
    Posts
    3

    Issue with Macro Stopping, need help

    Hello everyone, new to forums. Ive done some searching around but I can not find a real good answer as to a) why this happens, and b) how to work around it. Code first, problem after that.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    First, I know, my code is not the cleanest in the world. I accept that, I understand that. But that isnt really the issue. Here is what we deal with. Its a simple Time Sheet. It pulls all the hours for the employees into this Master Sheet, Hit the Macro button, boom, easy to do payroll. However we have 1 guy (Jonathan) who works remotely. He gets paid based on what he bills for.

    We use Spiceworks for our ticket system. My code breaks when dealing with Jonathan. The way it works is, I export the Spiceworks file, saved as Excel. The Macro is suppose to run where it breaks apart the Hours and Minutes, then gives me the total at the bottom of the spiceworks Excel sheet. Then the Macro is suppose to pull that information back into the Master Template and fill in Jonathan's stuff.

    Easy flow of how it works:
    1) Run Macro
    2) Get to Jonathan
    3) Window pops up to select Spiceworks File
    4) Do Hours and Minutes stuff on the Spiceworks file
    5) Pull info back to Template
    6) Resume with everyone elses stuff.

    How it actually works
    1) Run Macro
    2) Get to Jonathan
    3) Window pops up, select SW file
    4) Do Hours and minutes stuff on SW file
    5) Macro STOPS - Does not pull information back over.

    Its as though when having to do it on another sheet, the system forgets that a macro was working and running.

    Any thoughts on how to stop this from happening?
    Last edited by MeridianFrog; 07-11-2018 at 12:36 PM.

  2. #2
    Forum Contributor
    Join Date
    06-07-2018
    Location
    Newcastle Upon Tyne, England
    MS-Off Ver
    365
    Posts
    143

    Re: Issue with Macro Stopping, need help

    Hi MeridianFrog,

    The best thing for you to do is edit your post and then click the '#' icon from the message editor ribbon and then put each of your codes in separate #'s.

    This then displays the code with your tabs and indents like VBA.

    For example:

    Please Login or Register  to view this content.
    What would work even better is to post a desensitised version of your document
    Last edited by davo3286; 07-11-2018 at 10:50 AM.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Issue with Macro Stopping, need help

    Please put your code into code tags, per the forum rules.

    In the meantime, I'm surprised your code will run at all - it shouldn't compile.

  4. #4
    Registered User
    Join Date
    07-11-2018
    Location
    Florida
    MS-Off Ver
    Office 16
    Posts
    3

    Re: Issue with Macro Stopping, need help

    Hey there, Code tags put in. Sorry about that.

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Issue with Macro Stopping, need help

    I’m still surprised it runs. This line:

    Please Login or Register  to view this content.
    should be:

    Please Login or Register  to view this content.
    and this:

    Please Login or Register  to view this content.
    makes no sense to me unless you have a public routine called mwkb in the thisworkbook module.

  6. #6
    Registered User
    Join Date
    07-11-2018
    Location
    Florida
    MS-Off Ver
    Office 16
    Posts
    3

    Re: Issue with Macro Stopping, need help

    The Activeworkbook.mwkb was an attempt as a workaround to reset the workbook to the timesheet, to try and get the macro to continue working. As it stands right now, it runs through just fine for 'Jeff', but when it hits Jonathan, it does what its suppose to, goes to FileOpener. Opens the selected file, runs the code, but once it finishes with FileOpener, it doesnt return to the InfoPuller Function.

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Issue with Macro Stopping, need help

    My point really was that you should get an error with that code.

    I don't see why you pass Mwkb (which is Nothing) to that code. Also, is the file you open in that code the same one that the code then tries to open after that sub returns?

+ 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. [SOLVED] 1 Macro stopping another
    By Theangelp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-08-2017, 04:48 AM
  2. [SOLVED] Stopping a Macro after a Condition is met
    By JediJoker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2013, 12:45 PM
  3. Macro 'stopping' midway
    By rushdenx1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2010, 01:02 PM
  4. Stopping point for a macro
    By benno87 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2009, 04:37 AM
  5. [SOLVED] Macro stopping for one user out of 14
    By David Vollmer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2006, 02:55 PM
  6. [SOLVED] Stopping a Macro
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-07-2005, 10:15 AM
  7. Macro Stopping Before End :mad:
    By Nigel_hough in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2005, 08:13 AM

Tags for this Thread

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