View Single Post
 
Old 11-11-2015, 02:26 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by tesoke View Post
1) Why macros do not work after deleting, renaming or moving the source file, which we define them in it?
Because if you define the file as one thing, then change it to something else, how is the macro supposed to know? The only file a macro can work out file names & paths for after they've been changed is the file containing it. Even then, if you change a worksheet name, position in the file, add or delete a worksheet, that could break a macro. It is up to you to maintain the code so that it works in such cases.
Quote:
Originally Posted by tesoke View Post
2) Is there any way to solve this problem? Can we define macros in a way to not misworking after deleting, renaming or moving the source file?
Sure, but you have to code the macro to do what you want it to under such circumstances.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote