+ Reply to Thread
Results 1 to 13 of 13

User Login Form

  1. #1
    Forum Contributor
    Join Date
    04-18-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2021
    Posts
    154

    User Login Form

    Dear Sir's,

    user form working perfectly okay with specific user and appearing sheet as per code until security warning macro have been disabled (enable content) visible all sheet that i don't want every user to see expect start and only user login name sheet. please help me to solve this problem to show only start sheet when workbook open until user login.

    Attached the file for your reference.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-18-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2021
    Posts
    154

    Re: User Login Form

    getting run time error "1004" for below code

    Private Sub Workbook_Open()

    Dim ws As Worksheet
    Application.ScreenUpdating = False
    For Each ws In ThisWorkbook.Sheets
    If ws.Name <> "Start" Then
    ws.Visible = xlSheetHidden
    End If
    Next ws
    Application.ScreenUpdating = True

    End Sub

  3. #3
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    493

    Re: User Login Form

    Please Login or Register  to view this content.
    NOTE: As the original poster/owner, only you can mark your thread as SOLVED (Thread Tools above Post #1).
    You can say "Thanks" in your thread to everyone who offered to help you.
    You can also reward them by clicking * "Add Reputation" under their username on the left.
    With Regards, MikeVol.

  4. #4
    Forum Contributor
    Join Date
    04-18-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2021
    Posts
    154

    Re: User Login Form

    Dear Sir,

    Thank you and I apologize for the delay in responding. If I click on the file to open while some other Excel file is already open, it doesn't work and getting (there are one or more circular reference where a formula to its own cell either directly or indirectly. this migh cause them to calculate incoorectly. attached the image for your reference.

    Attachment 892192

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,538

    Re: User Login Form

    A fairly common mistake I see on the forums is setting sheets visibility in the Workbook_BeforeClose procedure. This is not a good place to do it. All I have to do is save the workbook and then close it (without saving), and the wrong worksheets are visible when I reopen the workbook. The right place to set sheets visibility is the Workbook_BeforeSave procedure.
    Below is the full set of routines that handle sheet visibility in the ThisWorkbook module.
    Please Login or Register  to view this content.
    The set is not perfect, but in the vast majority of cases sufficient.

    MdYas, by the way I rebuilt the logging process. Take a look at the attachment.
    I don't think the cyclic callback error is caused by VBA code. There must be another cause.

    Artik
    Attached Files Attached Files
    Last edited by Artik; 04-19-2025 at 06:02 PM.

  6. #6
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    493

    Re: User Login Form

    Hello my friend. How you coded your code, so it works, it is your fault!
    Change everywhere in the CommandButton1_Click procedure the following
    Sheets to ThisWorkbook.Worksheets
    well and everywhere where you have in the procedure
    ActiveWorkbook change to ThisWorkbook! And you will be happy. Good luck my friend.

  7. #7
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    493

    Re: User Login Form

    Quote Originally Posted by Artik View Post
    A fairly common mistake I see on the forums is setting sheet visibility in the Workbook_BeforeClose procedure. This is not a good place to do it.
    In this case, it is not the problem that the MdYas pointed out. Everything works fine if you make the above changes. Check it out of interest.

    Update! Artik, did you run your file as the user indicated above
    Quote Originally Posted by MdYas View Post
    If I click on the file to open while some other Excel file is already open, it doesn't work and getting (there are one or more circular reference where a formula to its own cell either directly or indirectly. this migh cause them to calculate incoorectly. attached the image for your reference.
    ??? Try doing the same thing sequentially. See the screenshot below.
    Attached Images Attached Images
    Last edited by MikeVol; 04-19-2025 at 01:48 PM.

  8. #8
    Forum Contributor
    Join Date
    04-18-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2021
    Posts
    154

    Re: User Login Form

    Dear Sir,
    Thanks, unfortunately getting same error

  9. #9
    Forum Contributor
    Join Date
    04-18-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2021
    Posts
    154

    Re: User Login Form

    Quote Originally Posted by MikeVol View Post
    Hello my friend. How you coded your code, so it works, it is your fault!
    Change everywhere in the CommandButton1_Click procedure the following
    Sheets to ThisWorkbook.Worksheets
    well and everywhere where you have in the procedure
    ActiveWorkbook change to ThisWorkbook! And you will be happy. Good luck my friend.
    Dear Sir,
    Thank you for your respond itried but getting compile error: Invalid outside procedure
    can you please help me to solve this problem

    Many thanks in adavce

  10. #10
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,538

    Re: User Login Form

    Gentlemen, the topic of this thread is user login and visibility of relevant sheets. And this is the only issue I was addressing when I saw the wrong answer from a forumer.
    Cyclic references are not even close to the topic of this thread rally so the problem with them should be published in a new thread.
    By the way, with me there are no messages about cyclic references. I also checked the workbooks with the macro below to make sure.
    Please Login or Register  to view this content.
    MdYas
    itried but getting compile error: Invalid outside procedure
    We don't know anything about how you improved the code, which is now reporting a compilation error. Attach a file with your corrections.

    Artik

  11. #11
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,538

    Re: User Login Form

    OK, managed to reproduce the problem of cyclic appeals. But I still think the topic should be published in a new thread.
    The following procedure will display in a new sheet the addresses of all cells in the workbook containing cyclic references and their formulas.
    Please Login or Register  to view this content.
    Artik

  12. #12
    Forum Contributor
    Join Date
    04-18-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2021
    Posts
    154

    Re: User Login Form

    Dear Sir,

    Thank you again for your help, I've attached the workbook when i changed as informed by Mr.MikeVol getting error or you can replace the code it will be very helpful to me.

    Have a good day
    Attached Files Attached Files

  13. #13
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    493

    Re: User Login Form

    Greetings my friend. I refuse to help you further because you have done nothing and have not changed anything in your existing code in the workbook that you provided in the post above. Artik and I have given working options (post #6 and post #11 here that you could apply yourself and your issue would be resolved. Do all the work for me, I do not consider it help. Do it yourself, with your own hands. Good luck my friend.
    Last edited by MikeVol; Yesterday at 03:40 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Create Login User Form with Multiple User
    By jaylyn_cpa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2019, 02:05 AM
  2. User Login Form
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2019, 05:54 PM
  3. Multi User Login Form - Help
    By tfilipe in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2018, 07:26 PM
  4. user form login
    By cwhite1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2016, 03:38 AM
  5. Access Login Form User Levels
    By Clayhead22 in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2015, 09:12 PM
  6. Access Login Form User Levels
    By Clayhead22 in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2015, 07:51 PM
  7. [SOLVED] User Login Form using VBA
    By sn152 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-08-2014, 11:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1