+ Reply to Thread
Results 1 to 6 of 6

Allow Cancel during SaveAs Dialog, when Filename is Specified

  1. #1
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    364

    Allow Cancel during SaveAs Dialog, when Filename is Specified

    Hi all

    I am using this code

    Please Login or Register  to view this content.
    It is generating the file name, based on a combination of values in different cells.

    What I would like is the user to be able to acutally cancel the save process.
    With the code above the file will be saved, even if the user clicks the cancel button.

    Thanks for your help in advance

    FD
    Last edited by FallingDown; 04-11-2014 at 06:51 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Allow Cancel during SaveAs Dialog, when Filename is Specified


    Hi,

    you can test the return value like in the sample in the VBA help of GetSaveAsFilename method …

    Regards !

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Allow Cancel during SaveAs Dialog, when Filename is Specified

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  4. #4
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    364

    Re: Allow Cancel during SaveAs Dialog, when Filename is Specified

    Hi patel45

    I actually tried that already
    The problem is that ir correctly aborts the save process.
    But the actual save ends in a "Runtime Error '13' - Type Missmatch" with this code.

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Allow Cancel during SaveAs Dialog, when Filename is Specified

    I can not test your code without the file

  6. #6
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    364

    Re: Allow Cancel during SaveAs Dialog, when Filename is Specified

    Hi Patel

    Thanks - I found my mistake

    For some reason i had

    Please Login or Register  to view this content.
    defined

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Window 7 - Excel 2010 setting? VBA ActiveSheet.SaveAs Filename not posting name to dialog
    By portews in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2013, 03:16 PM
  2. cancel Save and SaveAs according to condition
    By hakan439 in forum Word Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2011, 08:06 AM
  3. Add Instruction Code For NO or CANCEL within ActiveWorkbook.SaveAs
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-26-2010, 04:20 PM
  4. SaveAs - user pushing cancel corrupts the file
    By slankc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-21-2006, 06:10 PM
  5. How check for No/Cancel Button when SaveAs and file already exists?
    By Joe HM in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-19-2005, 06:06 AM

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