File save macro error

V

vrzimmerm

I am creating a macro that ends by saving the current file into a
directory specified by the user.

The user specifies the directory name thru the following command:

fldr = InputBox("Enter the 3 digit folder name")

Then, I am trying to use the following command to save the file into
the directory name that was just determined by the user.

Workbook.SaveAs ("C:\Documents and Settings\Administrator\My Documents\
$user\Hold\" & fldr & "\" & "Hold macro code.xls")

I keep getting a "Run time error 424" "Object required" error
message. I've verified that the path specified in my command is a
valid one. What is wrong with this command?

Thanks.
 
G

Guest

If you're trying to save the currently active workbook, try:

ActiveWorkbook.SaveAs ("C:\Documents and Settings\Administrator\My Documents\
$user\Hold\" & fldr & "\" & "Hold macro code.xls")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top