how to refer current location in vb code.
For eg.
In vb code I want to save my Active Worksheet say "X" with a different name say "Z" in current location(where X is saved). I don't want to give the entire path as the file can be in various location and executing the macro from those location should save the file with different name in that location only.
if I refer my existing file "X" to save as "\Z" it saves in root directory or i.e. in C: Drive and if I refer to save as ".\Z" it saves in my profiles "My Document" folder.
For eg.
In vb code I want to save my Active Worksheet say "X" with a different name say "Z" in current location(where X is saved). I don't want to give the entire path as the file can be in various location and executing the macro from those location should save the file with different name in that location only.
if I refer my existing file "X" to save as "\Z" it saves in root directory or i.e. in C: Drive and if I refer to save as ".\Z" it saves in my profiles "My Document" folder.