Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Error Message - File will NOT save Jennifer Excel Discussion (Misc queries) 1 May 20th 08 12:45 PM
file save error: the file or directory cannot be created dublg Excel Discussion (Misc queries) 1 September 25th 06 07:07 PM
Macro to save Excel file with date and time in the file name? sonic_d_hog Excel Programming 2 January 5th 06 05:57 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"