Hi all,
This is probably a dumb question, but is there any reason why I can't 're-set' a variable after I'm completely done with using it in it's prior context?
For example, let's say I have these lines (leaving aside variable declarations):
Set obj2FSO = CreateObject("Scripting.FileSystemObject")
Set obj2Folder = objFSO.GetFolder("C:\Something\FolderName")
obj2Folder.copy "D:"
Let's say after those lines run, I really don't need to use that folder in the middle statement again. Given that, can I then do this:
Set obj2Folder = objFSO.GetFolder("C:\NewFolder")
obj2Folder.copy "D:"
or, do I for some reason need to create totally new variables and use those in the second set of code lines?
Thanks for any feedback.
T
This is probably a dumb question, but is there any reason why I can't 're-set' a variable after I'm completely done with using it in it's prior context?
For example, let's say I have these lines (leaving aside variable declarations):
Set obj2FSO = CreateObject("Scripting.FileSystemObject")
Set obj2Folder = objFSO.GetFolder("C:\Something\FolderName")
obj2Folder.copy "D:"
Let's say after those lines run, I really don't need to use that folder in the middle statement again. Given that, can I then do this:
Set obj2Folder = objFSO.GetFolder("C:\NewFolder")
obj2Folder.copy "D:"
or, do I for some reason need to create totally new variables and use those in the second set of code lines?
Thanks for any feedback.
T