+ Reply to Thread
Results 1 to 14 of 14

Multiple users executing code in .xls file causing error

  1. #1
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Multiple users executing code in .xls file causing error

    I have an xls file that is executed by more than one user (a maximum of ten usually).It contains a form with a button and in the onclick event of that button the following code executes:

    Please Login or Register  to view this content.
    It stops with the following error (sometimes)



    Run Time error - 2147467259 (80004005)
    Record is deleted



    I didn't write the code but it is executing fine when there is only one person. The problem is that everone is accessing the same xls file (on a mapped drive) and it can't handle too many users (the database it is accessing is also on a mapped drive).

    Can anyone suggest a solution to this?

    Thank you for any replies

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple users executing code in .xls file causing error

    Are you closing the recordset and connection that this code opens?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Multiple users executing code in .xls file causing error

    Where does the error happen?
    Does the code need to change the data or read it only?

  4. #4
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple users executing code in .xls file causing error

    Quote Originally Posted by Norie View Post
    Are you closing the recordset and connection that this code opens?
    Please Login or Register  to view this content.
    Yes it goes on to some other code after that but it doesn't give the error there.
    Right at the end there is

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple users executing code in .xls file causing error

    Quote Originally Posted by Izandol View Post
    Where does the error happen?
    Does the code need to change the data or read it only?
    Unfortunatley I don't know the exact line of where the error occurs but I know it is somewhere in the block I posted.
    It is just reading from the db, no inserts, updates or deletes.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple users executing code in .xls file causing error

    fonzi

    I think it would help to know which line of code the error occurs on.

    Is the database being accessed by this code still being used by other people?

  7. #7
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple users executing code in .xls file causing error

    Quote Originally Posted by Norie View Post
    fonzi

    I think it would help to know which line of code the error occurs on.

    I haven't been able to find which line of code it goes down on as the Excel file is used by someone else and the error occurs when I am not there.
    Quote Originally Posted by Norie View Post
    Is the database being accessed by this code still being used by other people?
    Yes

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple users executing code in .xls file causing error

    Fonzi

    The database is still being accessed by other people that could be the problem.

    Have you looked into what's being deleted and who's deleting it?

  9. #9
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple users executing code in .xls file causing error

    Quote Originally Posted by Norie View Post
    Fonzi

    The database is still being accessed by other people that could be the problem.

    Have you looked into what's being deleted and who's deleting it?
    Nothing is being deleted from the database (even though the error is a delete error). The code only does a select.
    Actually since I posted about it first I have discovered that it is more of a location issue; the code is selecting from a database on a shared drive that is in a different country. That is maybe more the issue than contention/concurrency. The error is more of latency than anything else but I don't supoose there is much one can do in code to fix that.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple users executing code in .xls file causing error

    Nothing is ever deleted from the database, even by somebody not using this code?

  11. #11
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple users executing code in .xls file causing error

    Quote Originally Posted by Norie View Post
    Nothing is ever deleted from the database, even by somebody not using this code?
    OK I understand. The code I posted does not delete anything but there may be other apps that delete from it. I am sure that there is nothing being deleted somewhere else from the db at the time the code is executing.

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple users executing code in .xls file causing error

    What exactly are you doing with the recordset after it's opened?

  13. #13
    Registered User
    Join Date
    09-18-2013
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple users executing code in .xls file causing error

    Quote Originally Posted by Norie View Post
    What exactly are you doing with the recordset after it's opened?
    It grabs hold of each field in the recordset and enters it into cells in an Excel file (via a loop)
    Sorry I can't post the code;it's got sensitive information.

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple users executing code in .xls file causing error

    You don't need to loop to do that.

    This will put the data from the recordset on the active sheet starting at A1.
    Please Login or Register  to view this content.
    Even if that isn't exactly what you want you could dump the data with it, close the recordset (and connection) and then use code to do whatever you want with the data.

    PS We don't need to see any sensitive data, but the code would be nice.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Error when executing VBA code to remove all formulas from Workbook
    By brharrii in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-17-2013, 05:17 PM
  2. Getting error while executing VBA Code
    By Sahil1087 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-09-2012, 02:53 AM
  3. CSV empty file causing an error
    By scantron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2012, 04:31 PM
  4. Code to find last Column keeps causing an error
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-01-2012, 07:03 PM
  5. Protect/Unprotect code causing out of range error in code
    By Petrolcb41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2010, 02:34 PM

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