• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro not work in shard woorkbook

Abhijeet

Active Member
Hi
this macro not work in shard workbook I want run in shard workbook.Please help for this

Option Explicit
Private Sub Workbook_Open()

Dim nextrow As Long

nextrow = Sheet3.Cells(Rows.Count, "A").End(xlUp).Row

With Sheet3
.Cells(nextrow, "A") = Environ("username")
.Cells(nextrow, "B") = Now
End With

End Sub
 

Attachments

  • Shared file macro.xlsm
    15 KB · Views: 1
  • Shared file macro.xlsm
    15 KB · Views: 2
I changed the "A"s to 1 and the "B" to 2 and moved the code to the "This Workbook" code area, (not in a module), and it worked just fine.
 
Hi,

as you must already know, many things do not work in shared mode, so use it in normal mode …​
 
Hi, Abhijeet!

Use a new worksheet to hold the users that are logged in and then count from there. Anticipating your usual "give me macro" response, I won't give you any but the clues that'd help you build it:
a) Create a new worksheet.
b) Each time someone opens the workbook you should add its user name to 1st empty cell in column A of the worksheet of a)
c) Each time someone closes the workbook you should delete its user name from column A of the worksheet of a)
d) When you want to know how many users are using the shared workbook you should count the number of non-empty cells in column A of the worksheet of a)

That's all, I guess.

Regards!
 
Hi, Abhijeet!
I join Marc L recommendation, and I move forward: switch to Access, create a table for each worksheet, a form for those who require it, and get rid of Excel constraints about shared workbooks.
Regards!
 
Back
Top