LEETENY
10-25-2018, 06:32 AM
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
"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