Starting Excel in Read-Only Mode

We have been using several big spreadsheets almost as databases at my school, because the development time has been so much quicker and more flexible than using a traditional database (although, we will be moving to an SQL solution this coming year.)

The biggest problem at the moment of using a spreadshseet as a database, is the file locking issue of only one user being able to be logged in at a time.  We couldn’t find anything on the Internet, so today I cam up with a batch file hack that solves the problem allowing .  (The ping was added to basically pause the batch file for 10 seconds, so that the file could open before being set to read/write again.)

@echo off
attrib +r spreadsheet.xlsx
start excel spreadsheet.xlsx
ping localhost -n 10
attrib -r spreadsheet.xlsx

Leave a Comment

Your email address will not be published. Required fields are marked *