If folder doesn't exists

  • Have to code to save files to, but get error if the folder doesn't exist.Need a message box to say folder does not exist do you want to save in Misc. folder C:\Users\Tom\Retail\Sales\Misc yes or no option. no woulds
    exit the sub and yes would save.

  • Re: If folder doesn't exists


    Hi there,


    Looks like you want something along the lines of this

  • Re: If folder doesn't exists


    Here is the code I use now,works perfect if folder exists. Range C13 is the folder name

  • Re: If folder doesn't exists


    Quote from zplugger;738213

    Here is the code I use now,works perfect if folder exists. Range C13 is the folder name


    This doesn't show me where & how you've tried to incorporate the new code.

  • Re: If folder doesn't exists


    Sorry
    was using example and had problems. Here is the code.


  • Re: If folder doesn't exists


    try this

  • Re: If folder doesn't exists


    Not sure why but it says folder does not exist. I checked the folder in dropbox and all is good. I checked the value in C13 all is right,not
    sure why it does not see folder?.

  • Re: If folder doesn't exists


    It has to be in this part of code, I can make a simple folder Like (Sales) on C drive and it does not see it?


  • Re: If folder doesn't exists


    This code does a good job of putting in the strAltFolder,but it doesn't see the folder in strFolder. Not sure why it does not
    see the existing folder??

  • Re: If folder doesn't exists


    fix for the problem if so

  • Re: If folder doesn't exists


    Quote from zplugger;738341


    Dim strFolder AsString'Folder to check the existence of with a \ at the end
    strFolder = "c:\Sales


    The problem is also fixed if you include the "\" as per the comment which you have not done in your code. This can be picked up & corrected with

    Code
    If Not Right(strFolder, 1) = "\" Then strFolder = strFolder & "\"


    after you have assigned a value to strFolder

Participate now!

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