+ Reply to Thread
Results 1 to 3 of 3

FileName SaveAs

  1. #1
    alanford
    Guest

    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. #2
    Markus Scheible
    Guest

    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


  3. #3
    Registered User
    Join Date
    02-17-2005
    Location
    Texas
    Posts
    7
    I too am having a similar problem. Wish I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1