View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default SaveCopyAs method

Lee,

It doesn't have to be hard-coded. I was juts trying to show that you could
pre-pend it. Somewhere you have to determine what that path is, so you can
save that to a variable and use that.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Lee" wrote in message
...
Thanks for the reply. However, I should have added that
the path will not always be the same. The file will be
saved to a LAN directory folder that will vary from
project to project. That's why I didn't want to hard code
the path.
-----Original Message-----
Lee,

add the path to the command

ActiveWorkbook.SaveCopyAs "C:\myExcel\" & strClient & " "

& "Raw Sample.xls"
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"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"




.