Consulting

Results 1 to 4 of 4

Thread: Run-Time Error '1004"

  1. #1
    VBAX Newbie
    Joined
    Oct 2018
    Posts
    2
    Location

    Run-Time Error '1004"

    I am fairly new at creating Macros and I have created a workbook for my department to share and use. When my colleagues run the macro with out changing the file name it works great. But when they save the workbook in a new name and come back to run my macro they run in to the Error:
    "Run-time error '1004' Sorry, we couldn't find C:\Users\LTENY\Document\thefilename.xslsm. Is it possible it was moved, renamed or deleted? "

    When I debug the macro is looking for the original file name to run the macro.

    Is the solution to write the macro so that when the name is change it can be run with any name? If so I would love to get some help on to make this happen. I would appreciate any help.


    This is my current macro. I call it the master macro, but cause it make other macros run.


    Sub All()
    '
    ' All Macro
    '
    
    
    '
        Application.Run "'Subsidy Check Application Pilot.xlsm'!Start"
        Application.Run "'Subsidy Check Application Pilot.xlsm'!ARFLWUP"
        Application.Run "'Subsidy Check Application Pilot.xlsm'!Earn"
        Application.Run "'Subsidy Check Application Pilot.xlsm'!NoAction"
        Application.Run "'Subsidy Check Application Pilot.xlsm'!AGDisc"
        Application.Run "'Subsidy Check Application Pilot.xlsm'!Action"
        Application.Run "'Subsidy Check Application Pilot.xlsm'!BuildFW"
    End Sub
    Last edited by Paul_Hossler; 10-25-2018 at 07:04 AM.

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Welcome to the forum

    I added CODE tags to your macro. You can use the [#] icon to insert the pair and paste your macro between to set it off and format it nicely

    2. If the seven macros are in the workbook, you should be able to just run by name, without the .Run and the workbook name


    Option Explicit
    Sub All()
        Start
        ARFLWUP
        Earn
        NoAction
        AGDisc
        Action
        BuildFW
    End Sub
    If that's not it, come back with some more details.

    Also my sig has some reading materials and tips for new members, especially the part about cross posting to other forums without telling us
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Newbie
    Joined
    Oct 2018
    Posts
    2
    Location
    Paul,

    THAT WORKED!!! Oh my goodness! I have tried to research this so many times that I can't believe someone was able to help. This is my first ever forum to join or post, but I was getting so worried that I was not going to have finished project for a department of 200 people that needs to be rolled out in 2 weeks. Thank you SOOOOOO much!

    Like I said I'm fairly new and pretty much self taught with Macros, so I'm sure I will be back with more questions.

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Don't you hate it when computers do what you TELL them to do, and not what you WANT them to do

    Come back anytime with more questions

    Don't forget to mark your thread [SOLVED] -- #3 in my sig
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

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