+ Reply to Thread
Results 1 to 4 of 4

Stop CustomSave VBA if disk is full and file cannot be saved

  1. #1
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Stop CustomSave VBA if disk is full and file cannot be saved

    Hi all,

    I am using a custom "save" and "save as" routine, which works fine most of the time. Unfortunately, sometimes the shared drive is full and the saving is interrupted. Can I somehow stop the

    Please Login or Register  to view this content.
    if that happens? and show a message that saving wasn't successfull??

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Stop CustomSave VBA if disk is full and file cannot be saved

    Hi,

    You did not mention an error that you received from attempting to save the file to a full shared drive. Processing this error and then unhiding the sheets you hid is probably the easiest thing to do (if possible).

    Otherwise, see the following thread, which has functions that return the amount of free disk space on a 'shared drive'. You have to determine ahead of time how much disk space you need.
    https://www.mrexcel.com/forum/excel-...ive-space.html

    Lewis

  3. #3
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: Stop CustomSave VBA if disk is full and file cannot be saved

    The error I get when the shared drive is full, is the following:

    error_diskspace.PNG

    Then, as the saving routine is interrupted, my code goes into "Debug" mode once I click "OK"

    savinginterrupted.PNG

    And when I click "Debug" it highlights the "Me.Save" line.

    savingdebug.PNG

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Stop CustomSave VBA if disk is full and file cannot be saved

    The easiest thing to do code-wise is to anticipate the minimum amount of free space needed to save a file. If that amount of free space is NOT AVAILABLE, then display an appropriate message. You may want to do this when the file is opened, rather than creating a problem at save time.

    Please Login or Register  to view this content.
    Last edited by LJMetzger; 05-23-2018 at 10:54 AM.

+ 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. Disk full error
    By Himanshu Mishra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2012, 01:42 PM
  2. Excel 2007 : Disk Full error
    By Tomsimeone in forum Excel General
    Replies: 3
    Last Post: 03-25-2012, 05:47 PM
  3. Disk is full error
    By junior1505 in forum Excel General
    Replies: 4
    Last Post: 03-12-2011, 04:48 AM
  4. Excel says Disk full - when it is not
    By shazcords in forum Excel General
    Replies: 2
    Last Post: 12-06-2007, 12:26 PM
  5. disk is full error
    By integreat in forum Excel General
    Replies: 5
    Last Post: 07-27-2006, 10:16 PM
  6. disc full, saved to temp. file
    By charlies in forum Excel General
    Replies: 7
    Last Post: 05-18-2006, 03:45 PM
  7. Disk is Full Error
    By Julie _at_GBS in forum Excel General
    Replies: 0
    Last Post: 03-29-2005, 04:06 PM
  8. Disk is full
    By Eric in forum Excel General
    Replies: 0
    Last Post: 02-23-2005, 11:06 PM

Tags for this Thread

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