Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File save macro error
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
File save macro error
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") -- Hope that helps. Vergel Adriano " wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 Macro to Open File, Delete Contents, Save New File | Excel Discussion (Misc queries) | |||
Error Message - File will NOT save | Excel Discussion (Misc queries) | |||
file save error: the file or directory cannot be created | Excel Discussion (Misc queries) | |||
Macro to save Excel file with date and time in the file name? | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |