View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default SaveCopyAs method

Dim strClient As String
Dim sPath as Path
sPath = ActiveWorkbook.Path
if right(sPath) < "\" then sPath = sPath & "\"
strClient = Application.InputBox("Enter client name")
ActiveWorkbook.SaveCopyAs sPath & _
Trim(strClient) & " Raw Sample.xls"

--
Regards,
Tom Ogilvy


"Lee" wrote in message
...
I am trying to save a copy of a workbook with name and
save it in the same directory as the current workbook. My
problem is that Excel is saving it in the default
directory, My Documents. I know in Access, I would use
application.currentproject.path, but this doesn't seem to
be an option in Excel.

Here is the code I have so far:

Dim strClient As String
strClient = Application.InputBox("Enter client name")
ActiveWorkbook.SaveCopyAs strClient & " " & "Raw
Sample.xls"