+ Reply to Thread
Results 1 to 4 of 4

VBA file saving reliability - how reliable is it?

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    VBA file saving reliability - how reliable is it?

    To start, I'm not looking for different file saving methods (unless of course you have some cool new way to do it), more so, I'm posing this question: how reliable is the save as method for saving xls files through VBA? I pose this question because I have a workbook that is used by multiple people. One of the macros in this workbook saves the appropriate files to the appropriate directories based upon inputs the user has selected in the workbook. The macro is triggered off of a button click. I did not write the code behind this particular macro. Occasionally, I get buzzed in my office and am told a file that was supposed to save to a certain place didn't save, but it did print (which it should).

    What I find odd about this is I can't find much of a pattern to it. I've tested the code multiple times and cannot replicate the error. Furthermore, when someone alerts me to this issue, the first thing I always ask is "Did the program bug out?" because there is little to no error handling in the code. The program doesn't bug though, it just doesn't save the file like it should. This happens MAYBE 1 time out of 1,000 it seems. Possibly even less. I've reviewed the code several times, and everything appears spot on, except for the lack of error handling, so I've finally decided to post this question to those that may be in the know. Is saving through VBA 100% reliable? I just don't understand why the file wouldn't save and the code not bug out, especially since there is no error handling around this chunk of code. Anyone have any thoughts or input about your experiences?

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA file saving reliability - how reliable is it?

    in my experience a save will either work or raise an error, not fail silently, so I would suspect something else to be the cause
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA file saving reliability - how reliable is it?

    Ditto .
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA file saving reliability - how reliable is it?

    Is there an "On error resume next" statement anywhere in the vba code? If so, there is you 'silent' culprit.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ 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