Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Saving in Shared mode

I have an Excel spreadsheet that is being used in a SharedWorkbook state. I
have placed buttons on the tabs for my users to save the file instead of
using the save button on the Excel Menu Bar. I do this so the button can
update the time on the worksheet(s) to indicate what time the save occured.
The problem I am having is when 2 or more users try to save at the same
time, with or without using the button(s). The first user will be able to
save just fine but anyone else saving at that moment will get an error that
the file is locked and to try again later.

How can I make a loop that will detect if the file is busy and loop until
the file is available again, once available, perform the save?

Just off the top of my head, something like;

Do
If application locked "need help here" then
loop until application unlocked "need help here"
Else
Application.ActiveWorkBook.Save
End If

I hope this question makes sense.
Any help with this is greatly appreciated.
--
Stephen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Saving in Shared mode

I figured out my own answer.

Do
On Error Resume Next
ActiveWorkbook.Save
Loop until ActiveWorkbook.saved = True

Thank you.
--
Stephen


"Stephen sjw_ost" wrote:

I have an Excel spreadsheet that is being used in a SharedWorkbook state. I
have placed buttons on the tabs for my users to save the file instead of
using the save button on the Excel Menu Bar. I do this so the button can
update the time on the worksheet(s) to indicate what time the save occured.
The problem I am having is when 2 or more users try to save at the same
time, with or without using the button(s). The first user will be able to
save just fine but anyone else saving at that moment will get an error that
the file is locked and to try again later.

How can I make a loop that will detect if the file is busy and loop until
the file is available again, once available, perform the save?

Just off the top of my head, something like;

Do
If application locked "need help here" then
loop until application unlocked "need help here"
Else
Application.ActiveWorkBook.Save
End If

I hope this question makes sense.
Any help with this is greatly appreciated.
--
Stephen

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disappearing comments in shared mode Kaylee Excel Discussion (Misc queries) 0 September 5th 08 10:24 PM
Saving shared spreadsheets on a shared drive. Meridith Excel Discussion (Misc queries) 0 April 3rd 08 05:20 PM
Convert a wokbook to shared mode Don Rouse Excel Programming 2 September 16th 05 04:06 PM
Problem with file in "Shared Mode" [email protected] Excel Discussion (Misc queries) 0 March 4th 05 06:43 AM
how open dbf in shared mode? Sandra Excel Programming 0 November 16th 04 09:40 AM


All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"