more than 1 user

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
843
Office Version
  1. 365
Platform
  1. Windows
What i need is if a spreadsheet is being used it will say try again then when they click it will transfer if not being used.

Currently get it to say Please try again. Probabaly need to remove the read only part as i dont want the user opening the end sheet. not sure how to:confused:

managed to get a message saying workbook is in use please try again,

If ActiveWorkbook.ReadOnly = True Then
MsgBox "The Workbook is being accessed by another user. Please try again. ", vbOKOnly, "Read-Only"
'Exit the workbook.
ActiveWorkbook.Close False

Exit Sub
Else

then at the end

End If
MsgBox "The data has been submitted.", vbInformation, "Saved Data"



Application.ScreenUpdating = True
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
See:

http://www.mrexcel.com/forum/showthread.php?t=570404&highlight=userstatus

Please use
Code:
 tags when posting code here.[/QUOTE]
 
think thats for if you want to share and how many users. 
 
I dont want to see how many users, all I want is when somebody runs a macro from a book which transfers data to another book if more than 1 person transfers data at the same time, the second user will get a pop up saying Please try again and when they try again it transfers. the first part works by asking to try again although when 1st user has finished it says read only i dont want that
 
I want 2nd user to try again and it transfers without the option to open the second book
 
Upvote 0
I did edit the line


MsgBox "The Workbook is being accessed by another user. Please try again. ", vbOKOnly, "Read-Only"


to MsgBox "The Workbook is being accessed by another user. Please try again. ", vbOKOnly, ""

and the data transfers ok wih a message. but then I get the pop up saying File Now Available - 'Book 2.xls' is now available for editing. Choose Read Write to open for editing.

How do I stop this from popping up
 
Upvote 0
This is what i have

Code:
If ActiveWorkbook.ReadOnly = True Then
MsgBox "The Workbook is being accessed by another user. Please try again. ", vbOKOnly, ""
'Exit the workbook.
ActiveWorkbook.Close False

Exit Sub
Else

then some code which transfers data to book 2

then

Code:
ActiveWorkbook.Save
        ActiveWindow.Close
        
        Workbooks(NewName).Activate
        CutCopyMode = False
        ThisWorkbook.Activate
              
               
        
        End If
        
        
        MsgBox "Data has been submitted sucessfully.", vbInformation, "Saved Data"
        
             
       Application.ScreenUpdating = True

All I need is to somehow avoid the Popup regarding available for editing.

I saw a thread re: Application.DisplayAlerts = False but that didnt work
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

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