multiuser Excel application

unluckyuser

New Member
Joined
Jan 12, 2025
Messages
13
Office Version
  1. 2019
Platform
  1. Windows
Pondering the design of a front end that is forms driven and unchanged by the end user, who knows nothing of Excel. So if there's a crash, that file cannot be corrupted and even if it were, it's easily restored. The multi user data file will be in a different location. The only time I see any risk of corrupting is during the file writing process, when a field is changed and the file is saved. How would I prevent multiple people from trying to save simultaneously? Or is this really even a concern?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Sounds like a database application to me. Much better served using a platform like MSAccess.
 
Upvote 0
It is, and I know that. Unfortunately, the company only has Excel and won't budge on anything else.
 
Upvote 0
IIRC you only need one subscription with msAccess installed, the user base only needs the runtime
 
Upvote 0
How would I prevent multiple people from trying to save simultaneously?

Hi
As already stated, a database probably more suited to what you are trying to do but if your users will have access to the common workbook on your corporate network (LAN or WAN) then for each user to write data from their template file and avoiding write conflicts, you would need to first check that the workbook is not open write mode.

You should be able to do with simple function place in standard module in each template workbook

VBA Code:
Function FileInUse(ByVal FileName As String) As Boolean
    
    'check if file already open read/write
    On Error Resume Next
    Open FileName For Binary Access Read Lock Read As #1
    Close #1
    FileInUse = Err <> 0
    On Error GoTo 0
    
End Function

You call the function in the code for each template workbook that posts the users data as follows:

Rich (BB code):
Const strFileName As String = "S:\Users\unluckyuser\documents\shared filename.xlsx"
    
    If Not FileInUse(strFileName) Then
        'open file
        'do stuff
        'close & save file
    Else
        'inform user
        MsgBox "File In Use"
    End If

You will need to specify the correct filepath / filename but hopefully, suggestion will do what you want.

Hope Helpful

Dave
 
Upvote 0
@dmt32 Does this work reliably if the file is on either OneDrive or Sharepoint and in co-Authoring mode?

Unlikely for any of those situations which is why I stated LAN or WAN network.
Solution is a cut down version I implemented about 15+ years ago for my daughter with a similar requirement to OP at her place work where 250 users across UK submitted timesheet data each week to a common workbook - no conflict issues were ever reported.

Dave
 
Upvote 0

Forum statistics

Threads
1,226,074
Messages
6,188,727
Members
453,494
Latest member
Alt F11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top