+ Reply to Thread
Results 1 to 6 of 6

Macro Stopped Working for No Discernable Reason

  1. #1
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    262

    Macro Stopped Working for No Discernable Reason

    Hi Everyone!

    A while back I received help with the macro in this thread: https://www.excelforum.com/excel-pro...ml#post5256672

    I went to run it for the new year and the debug tool is getting caught up on the following:

    Please Login or Register  to view this content.
    I cannot for the life of me determine why this has become an issue. I have not changed the folder locations or file names as far as the macro should be concerned.

    The folder structure is as follows: Desktop>Department Dailies>Daily Dash Copies>Base Template

    Where the "Names for Dailies" sheet with the macro is in the "Daily Dash Copies" subfolder, and the template it should be replicating is in the "Base Template" subfolder.

    Anything I might be missing?

    EDIT: Using Excel 2016

    Thanks for your consideration.
    Last edited by liquidmettle; 01-02-2024 at 09:51 AM.

  2. #2
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,086

    Re: Macro Stopped Working for No Discernable Reason

    If it's just entering debug without any error you could try pressing Ctr+Break a few times next time it does it, then continue running.
    I get this phantom break point issue a fair bit and that always fixes it for me.

  3. #3
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    262

    Re: Macro Stopped Working for No Discernable Reason

    Hi Byte,

    So took me a moment of searching to realize that the pause key is the break key on my keyboard, but it didn't seem to do anything when I mashed it with ctrl, and ctrl+fn. I tried the onscreen keyboard as well (and that seemed to map my pause key to scroll lock even with the scroll lock next door). Clicking the onscreen keyboard pause didn't seem to have an effect.

    I double checked and the error I was getting was Run-time error '-2147352571 (80020005) The item with the specified name wasn't found.

    I'm thinking that means the part of the code that is throwing fits is "Filepath & Workbooks("Names for Dailies")" since the N4D workbook is not in the Base Template folder but rather one directory up. But this still confuses the hell out of me since this code has worked reliably for years (and I only run it 1-2 times a year).

    The "myfile" finds the proper base template to copy in the directory when I hover over it, so I'm just stumped.

    I also tried making a second filepath named filepath 2 that stopped at the Daily Dash Copies folder level thinking maybe it wasn't finding the N4D workbook but no dice.

  4. #4
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    262

    Re: Macro Stopped Working for No Discernable Reason

    Made a little progress.

    Changed the line to read from:

    Please Login or Register  to view this content.
    To:

    Please Login or Register  to view this content.

    The macro proceeds, copies the template file and renames its with the first entry in the "Names for Dailies" column A.

    It gets tripped up again when I try to have it add other values from the Names for Dailies workbook (where the code is), to the copied file.

    The problem is definitely the vba knowing to reference the open workbook I started with. I tried tinkering with activeworkbook but definitely don't remember the proper syntax.


    Full Code:

    Please Login or Register  to view this content.
    Last edited by liquidmettle; 01-02-2024 at 01:04 PM.

  5. #5
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,086

    Re: Macro Stopped Working for No Discernable Reason

    What if you store the source worksheet in a variable?


    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    262

    Re: Macro Stopped Working for No Discernable Reason

    Hi Byte,

    First, your code worked perfectly!

    Second, I had stumbled on an alternate solution just about when you were posting yours, and that was to add the extension in the sheet name. I ran your code as well to verify and both worked great (yours is much cleaner though and will likely be what I keep).

    Thank you for your help!!


    Alternate code (has one or 2 other tweaks as well):
    Please Login or Register  to view this content.

+ 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 Stopped Working
    By Kpina in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-29-2019, 04:21 AM
  2. [SOLVED] VBA code stopped working for no reason
    By kunkka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2017, 01:38 PM
  3. [SOLVED] Macro stopped working?
    By AmyV1 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-22-2017, 10:23 PM
  4. Macro stopped working
    By EverettRich in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-21-2013, 03:17 PM
  5. Macro Stopped Working
    By andybason in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2012, 01:20 PM
  6. Macro stopped working.
    By joleen in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-06-2011, 05:37 AM
  7. Excel 2007 : Macro stopped working
    By jaw0001 in forum Excel General
    Replies: 5
    Last Post: 10-13-2010, 07:59 AM

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