View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Zone[_2_] Zone[_2_] is offline
external usenet poster
 
Posts: 43
Default Worksheet to be saved in current directory

If you want to save the workbook in the same path as the active workbook,
this should work:

ActiveWorkbook.SaveAs Filename= activeworkbook.path & "\Bookdoc " &
Format(Now, "yyyy-mm") & ".xls"

James

"Pepestru" wrote in message
...
At the end of a macro I save the worksheet. The following statement works
for
me, but how should the code be to make this work on another users computer
with another directory structure? (I copied this statement from another
answer - my knowledge of VBA is very limited!)
I save with:
ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Owner\My
Documents\VvEAH\Finance\2007\Bookdoc " & Format(Now, "yyyy-mm") & ".xls"
The question is actually: how do I get the path of the worksheet in use
and
use that in the save statement?
Thanks,
Paul
P.S. I asked this question earlier, but cannot find it back.....!