Results 1 to 6 of 6

Thread: [RESOLVED] Excel To a Form

  1. #1

    Thread Starter
    Lively Member jholokai02's Avatar
    Join Date
    Jan 2005
    Location
    Rockport, Texas
    Posts
    104

    Resolved [RESOLVED] Excel To a Form

    Not too sure if I am posting this in the right place, but here goes.

    I have an Excel Spreadsheet that is specified by the user via the Common Dialog control. I want to be able to put the file in a Flex Grid or something along those lines (If there are any suggestions as to which control to use, I'm all ears) so that the user can edit it within the VB Form. I searched the Forums, but to no avail. If someone could help me, it would be greatly appreciated.

    Thanks

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,501

    Re: Excel To a Form

    A FlexGrid would work, but you would have to enable the editing yourself (as it isn't built in). Here is an example by MartinLiss of how you can do it.

    In terms of getting data from Excel (and presumably putting it back again afterwards), see the Excel Tutorial link in my signature.


    Alternatively, you could use the OLE control (which will show the file as if it is in Excel, but inside your form). I can't really help with how to do that I'm afraid, I only used it once and found it too restrictive to bother with.

  3. #3

    Thread Starter
    Lively Member jholokai02's Avatar
    Join Date
    Jan 2005
    Location
    Rockport, Texas
    Posts
    104

    Re: Excel To a Form

    I liked how the Flex Grid worked, but I need the user to be able to scroll through each sheet in the workbook. I didn't see that feature within the Flex Grid. I don't think that the feature is available with the OLE Object either. The only one that I saw was the Excel Sheet Object, and I am lost when it comes to that. Any opinions.

    Oh, I already have the program pulling up a user defined file, I would just like for the user to be able to edit/search, save, etc.


    Thanks for the response.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,501

    Re: Excel To a Form

    To switch sheets you could use one of a variety of "extra" controls. You could have a combobox which lists the sheet names, and switch sheets when the selection changes.

    You could use a Tab control (which will look fairly similar to the Excel tabs) to a similar effect. You could even use an array of buttons.


    edit: Alternatively you could go for the simple route, and show the file in Excel. I have no idea how appropriate this is for you tho.

  5. #5

    Thread Starter
    Lively Member jholokai02's Avatar
    Join Date
    Jan 2005
    Location
    Rockport, Texas
    Posts
    104

    Re: Excel To a Form

    I guess that using Excel in itself would be the simplest route. If for some reason you think of something else, please let me know. Thanks for the information.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,501

    Re: [RESOLVED] Excel To a Form

    Cool, the simplest code would probably be as in this FAQ thread. This will open the files in their default application on the computer (which should be Excel if it is installed).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width