Workbook automatically saving in different places problem

  • Hi,


    Since a few days my excel workbook is behaving kinda strange...
    It's supposed to auto save when closed. Lately, it doesn't only save in the original location on the server, but also in other places, even local.
    Whenever a user opened a folder in explorer and then afterwords opens and closes the workbook I'm talking about, a copy is saved to the folder that was opened earlier and is still active.
    What makes it even more strange is that this doesn't always happen, and that the changes made to the workbook are only changed in the Original workbook and not in the copy...


    The code I use to auto save is this one:



    Anyone an idea what might be causing this?


    Thanks in advance!


    Tommy

  • Re: Workbook automatically saving in different places problem


    It will just be defaulting to the last place you saved an excel sheet.


    Put this line at the top of your code


    Code
    Dim relativePath As String


    And have this in place of your save line.


    Code
    relativePath = ThisWorkbook.Path & "\" & ActiveWorkbook.Name
        ActiveWorkbook.SaveAs Filename:=relativePath


    This will ensure it saves in the current location.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!