+ Reply to Thread
Results 1 to 3 of 3

muliple users - issue unique session number

  1. #1
    Registered User
    Join Date
    09-02-2005
    Posts
    2

    muliple users - issue unique session number

    I have a data entry form which, every time it is started by a user, needs a unique session number. For this I included a procedure that opens a separate xls file (numbers.xls), in which the unique numbers are stored. Every time my form starts up, numbers.xls is openened, and a new, unique number is issued for the session. This new number is the highest existing number in numbers.xls, raised by1. This new highest number is then stored in numbers.xls, afther which numbers.xls is saved and closed.
    The problem occurs when different users start up the form at the more or less the same time: the second one to open the form, actually opens a copy of the xls file, so that both users have the same session number (I noticed that the second user does get the 'file will be opened as read only' message, but it appears behind the form).
    How can I ensure that a new number is not issued befor the previous user has closed and saved the file? (or provide the users with a unique session number in another way) ?
    greetings from jurjen

  2. #2
    Bob Phillips
    Guest

    Re: muliple users - issue unique session number

    Test the read-only property of the workbook, and loop closing and opening
    until False.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "jurjen" <jurjen.1uq7qb_1125655524.6332@excelforum-nospam.com> wrote in
    message news:jurjen.1uq7qb_1125655524.6332@excelforum-nospam.com...
    >
    > I have a data entry form which, every time it is started by a user,
    > needs a unique session number. For this I included a procedure that
    > opens a separate xls file (numbers.xls), in which the unique numbers
    > are stored. Every time my form starts up, numbers.xls is openened, and
    > a new, unique number is issued for the session. This new number is the
    > highest existing number in numbers.xls, raised by1. This new highest
    > number is then stored in numbers.xls, afther which numbers.xls is saved
    > and closed.
    > The problem occurs when different users start up the form at the more
    > or less the same time: the second one to open the form, actually opens
    > a copy of the xls file, so that both users have the same session number
    > (I noticed that the second user does get the 'file will be opened as
    > read only' message, but it appears behind the form).
    > How can I ensure that a new number is not issued befor the previous
    > user has closed and saved the file? (or provide the users with a unique
    > session number in another way) ?
    > greetings from jurjen
    >
    >
    > --
    > jurjen
    > ------------------------------------------------------------------------
    > jurjen's Profile:

    http://www.excelforum.com/member.php...o&userid=26919
    > View this thread: http://www.excelforum.com/showthread...hreadid=401413
    >




  3. #3
    Registered User
    Join Date
    09-02-2005
    Posts
    2
    thanks! The read-only check is what I needed
    cheers,
    jurjen

+ 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