+ Reply to Thread
Results 1 to 4 of 4

Store FilePath Inside Code

  1. #1
    Magnivy
    Guest

    Store FilePath Inside Code

    Hello,

    I have a macro that pastes data into a file, say File A, from all files in a
    specific folder. I'm trying to enhance the macro by having a MessegeBox pop
    up before the macro executes that asks whether the uses wants to use a
    different folder than the one used previously. If the uses clicks "Yes" on
    the MessegeBox, an InputBox pops up that asks the user for the path of the
    new file.

    The problem is that I if the user clicks "Yes" in the MessegeBox and enters
    a new folder in the InputBox, I need to be able to store the path, so that
    next time, if the user clicks "No", the macro will know the path to the
    previously used folder.

    Any help on how to accomplish the above would be greatly appreciated.

    Thank You!

    Magnivy

  2. #2
    Tom Ogilvy
    Guest

    RE: Store FilePath Inside Code

    http://www.j-walk.com/ss/excel/tips/tip29.htm

    can't you write it to a cell, perhaps on a hidden sheet.

    --
    Regards,
    Tom Ogilvy


    "Magnivy" wrote:

    > Hello,
    >
    > I have a macro that pastes data into a file, say File A, from all files in a
    > specific folder. I'm trying to enhance the macro by having a MessegeBox pop
    > up before the macro executes that asks whether the uses wants to use a
    > different folder than the one used previously. If the uses clicks "Yes" on
    > the MessegeBox, an InputBox pops up that asks the user for the path of the
    > new file.
    >
    > The problem is that I if the user clicks "Yes" in the MessegeBox and enters
    > a new folder in the InputBox, I need to be able to store the path, so that
    > next time, if the user clicks "No", the macro will know the path to the
    > previously used folder.
    >
    > Any help on how to accomplish the above would be greatly appreciated.
    >
    > Thank You!
    >
    > Magnivy


  3. #3
    Magnivy
    Guest

    RE: Store FilePath Inside Code

    That would work too. I just thought that there might be some easy way to
    store the path inside the code that I didnt come across.

    Thanks for your help!

    Magnivy

    "Tom Ogilvy" wrote:

    > http://www.j-walk.com/ss/excel/tips/tip29.htm
    >
    > can't you write it to a cell, perhaps on a hidden sheet.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Magnivy" wrote:
    >
    > > Hello,
    > >
    > > I have a macro that pastes data into a file, say File A, from all files in a
    > > specific folder. I'm trying to enhance the macro by having a MessegeBox pop
    > > up before the macro executes that asks whether the uses wants to use a
    > > different folder than the one used previously. If the uses clicks "Yes" on
    > > the MessegeBox, an InputBox pops up that asks the user for the path of the
    > > new file.
    > >
    > > The problem is that I if the user clicks "Yes" in the MessegeBox and enters
    > > a new folder in the InputBox, I need to be able to store the path, so that
    > > next time, if the user clicks "No", the macro will know the path to the
    > > previously used folder.
    > >
    > > Any help on how to accomplish the above would be greatly appreciated.
    > >
    > > Thank You!
    > >
    > > Magnivy


  4. #4
    Tom Ogilvy
    Guest

    RE: Store FilePath Inside Code



    You can modify code with code, but I wouldn't call it easy and if you want
    to lock your code, then that isn't an option.

    http://www.cpearson.com/excel/vbe.htm

    --
    Regards,
    Tom Ogilvy


    "Magnivy" wrote:

    > That would work too. I just thought that there might be some easy way to
    > store the path inside the code that I didnt come across.
    >
    > Thanks for your help!
    >
    > Magnivy
    >
    > "Tom Ogilvy" wrote:
    >
    > > http://www.j-walk.com/ss/excel/tips/tip29.htm
    > >
    > > can't you write it to a cell, perhaps on a hidden sheet.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Magnivy" wrote:
    > >
    > > > Hello,
    > > >
    > > > I have a macro that pastes data into a file, say File A, from all files in a
    > > > specific folder. I'm trying to enhance the macro by having a MessegeBox pop
    > > > up before the macro executes that asks whether the uses wants to use a
    > > > different folder than the one used previously. If the uses clicks "Yes" on
    > > > the MessegeBox, an InputBox pops up that asks the user for the path of the
    > > > new file.
    > > >
    > > > The problem is that I if the user clicks "Yes" in the MessegeBox and enters
    > > > a new folder in the InputBox, I need to be able to store the path, so that
    > > > next time, if the user clicks "No", the macro will know the path to the
    > > > previously used folder.
    > > >
    > > > Any help on how to accomplish the above would be greatly appreciated.
    > > >
    > > > Thank You!
    > > >
    > > > Magnivy


+ 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