Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default FileName SaveAs

Hi there guys,
I need to achieve a saveas function with vba from a *.xtl
1) Cell c3 contains a text that will act as the file name.
2) the code needs to use this text as file name and save it to a
directory C:\windows\desktop\dummy\.
3) if the file exists then the user needs to be prompted to save or
rename in that directory.

what I have so far is


Workbooks("book1.xtl").SaveAs Filename:="C:\windows\desktop\dummy\" &
Range("c2").Value & ".xls"

the above works fine until the system finds that the filename exists
and instead of asking the user if he wants to save over or change the
name it goes into BREAK mode. Can I get around it?

Thank you again.


Alan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default FileName SaveAs

Hi Alan,


what I have so far is


Workbooks("book1.xtl").SaveAs

Filename:="C:\windows\desktop\dummy\" &
Range("c2").Value & ".xls"

the above works fine until the system finds that the

filename exists
and instead of asking the user if he wants to save over

or change the
name it goes into BREAK mode. Can I get around it?



Very confusing, because my Excel (excel97) works fine with
that command and prompts: "a file named abcd.xls already
exists, do you want to replace it?" What exactly gives
excel back as the "BREAK mode"?

BTW: try savecopyas instead of saveas... but afaik this
will not prompt the user but overwrite it automatically...

Strange, though.


Best

Markus

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
SaveAs Filename and FileFormat in Vs2007 RobN[_2_] Excel Discussion (Misc queries) 4 July 14th 07 01:21 AM
SaveAs using two cells for filename David Excel Discussion (Misc queries) 5 June 4th 05 11:46 AM
'ActiveWorkbook.SaveAs Filename' TOMB Excel Programming 2 February 16th 05 12:51 AM
Set Saveas Filename from Cell Contents Using VBA Celtic_Avenger Excel Programming 1 September 5th 04 10:57 PM
SaveAs Filename Help Ed[_14_] Excel Programming 2 November 20th 03 08:43 PM


All times are GMT +1. The time now is 08:12 AM.

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"