+ Reply to Thread
Results 1 to 12 of 12

Can a form be opened without opening up/displaying the workbook?

  1. #1
    Registered User
    Join Date
    09-16-2012
    Location
    Darwin, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Can a form be opened without opening up/displaying the workbook?

    Hi, I'm new to using forms and would like to know if a form can be displayed without the user having to open up the whole workbook (ie. when the user double clicks the excel spreadsheet, only the form is displayed and the workbook is hidden). The reason I ask is that I want to create an application that can be used with a barcode scanner to search for and/or update products in a spreadsheet that I have already created but I dont want the user to have access to the workbook.
    In the spreadsheet, there is one entry per item that gives an item description, a location and the item's barcode (I've attached a small example of the data within my spreadsheet). What I want to be able to do is scan an item's barcode and have excel search for and pull up the corresponding entries (description, barcode and location) and display them back to me within the form itself rather than opening up the worksheet and showing me the full line. Is this possible?
    Once I've successfully achieved this, I plan to extend this to allow the user to update the line on the form (if a location changes for example) and have the new info updated in the worksheet.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Can a form be opened without opening up/displaying the workbook?

    I don't see any code and any form in the attached file
    If solved remember to mark Thread as solved

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Can a form be opened without opening up/displaying the workbook?

    Hello amhulli,

    Welcome to the Forum!

    You should include which barcode software you using with this project. If you are referring to a VBA UserForm then technically you can not because the UserForm is part of the workbook. However, you can hide the workbook sheets and menus, well at least you can in Excel 2003 and earlier. Not sure if this trick still works with 2007 and 2010. The code must be fully debugged and have error handling. Once the main menu is removed, you will only be able to close and save the workbook changes using the UserForm.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Can a form be opened without opening up/displaying the workbook?

    Yes.There is one way.Try this code

    Please Login or Register  to view this content.
    Last edited by thameem127; 09-18-2012 at 01:07 PM.

  5. #5
    Registered User
    Join Date
    09-16-2012
    Location
    Darwin, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can a form be opened without opening up/displaying the workbook?

    Thanks guys, I'll give Thameem127's code a try and see how it goes. Ta.

  6. #6
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Can a form be opened without opening up/displaying the workbook?

    Quote Originally Posted by amhulli View Post
    Thanks guys, I'll give Thameem127's code a try and see how it goes. Ta.
    Hai amhulli did u check my code.Let me know if your satisfied.

    Thanks

    Thameem

  7. #7
    Registered User
    Join Date
    09-16-2012
    Location
    Darwin, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can a form be opened without opening up/displaying the workbook?

    Thameem, I tried your code but couldnt make it work. I suspect it is because I am using it in the wrong location. In the VB window, I inserted your code into the "ThisWorkbook" Object. If not, could you please give me a hint as to where it needs to go?

  8. #8
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Can a form be opened without opening up/displaying the workbook?

    Quote Originally Posted by amhulli View Post
    Thameem, I tried your code but couldnt make it work. I suspect it is because I am using it in the wrong location. In the VB window, I inserted your code into the "ThisWorkbook" Object. If not, could you please give me a hint as to where it needs to go?
    Go to VBA editor ----> insert module ----->copy my code--->-save and close your workbook-----> open again now u can see userform1 automatically

    populate.

  9. #9
    Registered User
    Join Date
    09-16-2012
    Location
    Darwin, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can a form be opened without opening up/displaying the workbook?

    Thameem, The form opens automatically but the spreadsheet also opens maximised rather than minimised. Any thoughts?

  10. #10
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Can a form be opened without opening up/displaying the workbook?

    Quote Originally Posted by thameem127 View Post
    Yes.There is one way.Try this code

    Please Login or Register  to view this content.
    I just moved code from line three t0 line two

  11. #11
    Registered User
    Join Date
    09-16-2012
    Location
    Darwin, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can a form be opened without opening up/displaying the workbook?

    Thameem, all sorted - thanks for your help.

  12. #12
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Can a form be opened without opening up/displaying the workbook?

    Your welcome.Don't forget to click Star button.

    Thanks

    Thameem

+ 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