+ Reply to Thread
Results 1 to 7 of 7

Use userform collected data to open a file

  1. #1
    Registered User
    Join Date
    09-30-2009
    Location
    Alexandria, VA
    MS-Off Ver
    Excel 2010
    Posts
    31

    Use userform collected data to open a file

    Hi, I'm trying to use a userform to open a previously saved file to avoid having the users dig through the folder and maybe work on the wrong file.

    I have a file I have created to test if the code works, but the macro keeps giving me the reponse I set in case it doesn't find the file.

    The data for Account (Account1 and Subaccount1) is coming from a text box, as well as for category (Category1). The data for Company is an optionbutton frame with 4 options for the user to select from. Thanks in advance for any help!!!

    Please Login or Register  to view this content.
    Last edited by gophins; 10-29-2009 at 05:19 PM. Reason: Solved

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Use userform collected data to open a file

    Store the path & name in a hidden sheet
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-30-2009
    Location
    Alexandria, VA
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Use userform collected data to open a file

    Roy, thanks for the response.

    I'm not quite sure I understand, do you mean I must transfer the data I collect in the userform to a cell and then it would find the file?

    Thank you.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Use userform collected data to open a file

    I mant you could store the path in a worksheet then retrieve it with the code.

    can you attach a sample workbook

  5. #5
    Registered User
    Join Date
    09-30-2009
    Location
    Alexandria, VA
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Use userform collected data to open a file

    Here is the first tab of the spreadsheet. The "Continue on a previously saved account" has the macro in question attached to it. I had removed other tabs but it should not have an impact.

    Thank you!
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Use userform collected data to open a file

    I can't really heck this but it looks like the name is incorrect try checking it by adding a messagebox

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-30-2009
    Location
    Alexandria, VA
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Use userform collected data to open a file

    Thanks!! It was a silly mistake and placing the msg box helped me catch it right away.
    Thank you very much!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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