+ Reply to Thread
Results 1 to 5 of 5

User prompt -> Open file -> Perform action

  1. #1
    Registered User
    Join Date
    03-24-2006
    Posts
    38

    User prompt -> Open file -> Perform action

    Hello,

    I have a progam that performs certain database actions on a csv file (f.x. transforms to excel, rearranges, copy-pastes, creates new processed file).
    For this to work i have up until now required the user to save this csv file as a specified constant filename so that the code recognizes it. The code is something like: Workbooks("csvfile.csv").activate. What i would rather do is make some kind of prompt, where the user can choose what file to process, a.k.a i want the user too choose from a standard windows "open file" window, preferable with some kind of standard path. When VBA has the opened this file, i think activesheet will be enough the rest of the process. Do you have any suggestions?

  2. #2
    Xcelion
    Guest

    RE: User prompt -> Open file -> Perform action

    Hi ,
    Use Application.GetOpenFilename method so that user can browse the required
    file

    Thanks
    Xcelion




    "erikhs" wrote:

    >
    > Hello,
    >
    > I have a progam that performs certain database actions on a csv file
    > (f.x. transforms to excel, rearranges, copy-pastes, creates new
    > processed file).
    > For this to work i have up until now required the user to save this csv
    > file as a specified constant filename so that the code recognizes it.
    > The code is something like: Workbooks("csvfile.csv").activate. What i
    > would rather do is make some kind of prompt, where the user can choose
    > what file to process, a.k.a i want the user too choose from a standard
    > windows "open file" window, preferable with some kind of standard path.
    > When VBA has the opened this file, i think activesheet will be enough
    > the rest of the process. Do you have any suggestions?
    >
    >
    > --
    > erikhs
    > ------------------------------------------------------------------------
    > erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
    > View this thread: http://www.excelforum.com/showthread...hreadid=531857
    >
    >


  3. #3
    Registered User
    Join Date
    03-24-2006
    Posts
    38
    Thank you very much!

    As i am lazy today, could you please tell me if i can have some default folder to display?

  4. #4
    Tom Ogilvy
    Guest

    Re: User prompt -> Open file -> Perform action

    chdrive "C"
    Chdir "C:\MyFolder"
    fname = Appliction.GetOpenFileName()

    --
    Regards,
    Tom Ogilvy



    "erikhs" wrote:

    >
    > Thank you very much!
    >
    > As i am lazy today, could you please tell me if i can have some default
    > folder to display?
    >
    >
    > --
    > erikhs
    > ------------------------------------------------------------------------
    > erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
    > View this thread: http://www.excelforum.com/showthread...hreadid=531857
    >
    >


  5. #5
    Registered User
    Join Date
    03-24-2006
    Posts
    38
    Thank you! As always this forum is fast and reliable!

+ 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