Results 1 to 10 of 10

Thread: working with excel file...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    working with excel file...

    Hi,

    I have a problem...I want to do the difference of stock value in two columns wich they are in two different excel file. In file1.xls there are products and how many exists and the other one contain products and how many must be (minim stock). I need to find the difference between e.g. book1....6pcs and book1......3pcs.
    iF YOU HAVE SOME TIME FOR MY PROBLEM, please give me an exemple.

    Thanks a lot!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: working with excel file...

    Welcome to the forums.

    Basic question: Do you have the code in place to connect to, and open, both files already in place in your VB6 project?

    In other words, the only thing you need is suggestion on how to do the comparison, right? Everything else is working?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    Re: working with excel file...

    thanks for your answer.
    I need to help me to connect ADO with excel files and to do the comparison... It's enough for begin the application, I do some applications but with MSAcces
    thanks again

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: working with excel file...

    Ok, we need to start with the basics.

    For that, please go through si_the_geek's excellent tutorial on Automating Excel With VB6 tutorial.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: working with excel file...

    After you have gone through the tutorial and are comfortable with its code and concepts, have a look
    at one of these to see if they fit your needs.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    Re: working with excel file...

    thanks, your links are verry good.
    Now, I want to solve alone the problem.

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

    Re: working with excel file...

    Thanks for the compliment Hack, but I think in this case ADO would be a better idea than automation.

    I don't use Excel that way myself, but somebody posted a useful link about it the other day: http://support.microsoft.com/kb/278973

    Using this you should be able to connect to the files, but it would be much easier if you have both sheets in the same workbook - as you can then join the 'tables' easily (I'm not even sure if it is possible to work with 'tables' in different files).

  8. #8

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    Re: working with excel file...

    I have an idea... i try to send the both columns in MSAcces with ADO, then it easy for me to do the difference of quantity products. It's a good idea?
    But, joing the columns into one workbook is it a good thinks...

  9. #9

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    Re: working with excel file...

    my problem is to chek the quantity products from an excel files (basic) with minim quantity products from an excel file create from me (minim stock) and if quantity is almost with minim stock a message apear.

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

    Re: working with excel file...

    If the data is in existing file(s), the simplest solution is to use a query to Join them. You could import the data into MS Access, and I think that would be better than importing both sheets into the same Excel file.

    However, the bold part of your post ("file create from me") means that there may be better methods. How are you creating this file? Are you creating it with a program/macro from another source?

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