1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: EXCEL: auto open

Discussion in 'Business Applications' started by sk0101, Oct 2, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. sk0101

    sk0101 Thread Starter

    Joined:
    Nov 8, 2007
    Messages:
    277
    Hi,

    When I open the excel a Sub Auto_Open() is been executed...

    Is there away to count how many times the Excel was opened??

    Thank you
     
  2. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    The easiest way to do this is to store the running count in an unused cell. Each time the workbook is opened you would just increment the number using VBA code. You can store the value on a hidden sheet so that the end user is not aware of it.

    Regards,
    Rollin
     
  3. sk0101

    sk0101 Thread Starter

    Joined:
    Nov 8, 2007
    Messages:
    277
    Great Idea. Thanks Rollin
     
  4. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    It is a great idea. But you need to add ActiveWorkbook.Save right after incrementing the number (unless what you really want is a count of how many times the workbook was changed).

    HTH
     
  5. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    Hi there,

    To save on Excel overhead, I would think about using a text file to append to in your auto open. Doing it this way will save any additional sub routines from running. One routine, one update. Let us know if you'd like something like that. In fact, most of it is already worked out here: http://www.vbaexpress.com/kb/getarticle.php?kb_id=351

    Take care!
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/755515

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice