Both RVLF & astra1 are correct. If you try to refresh a cube and someone has the same cube open, then the final write to the cube will fail.
However using atra1's batch file is the perfect way to automate the re-freshing of cubes.
I run schedular every night, just to run a batch file like atra1 has shown here, with 7 differnt cubes.I use schedular to "kick-off" the batch file at 1:00am, and then when I come in in the morning, all the cubes are fresh.This way refresh the data, and not run into a sharing conflicts with your users.
If you must re-fresh while people are around, RVLF's solution can be used in combination with batch files.
Bruce