Consulting

Results 1 to 5 of 5

Thread: Force users to classify documents before close

  1. #1

    Force users to classify documents before close

    Hi,

    System should force users to classify the excel documents as Internal, Public, Confidential before they close.

    1. I want the classification option to be provided as radio button in alert message box
    2. User cannot close the message box unless they choose any option
    3. If the user closes the inner (x) close button also, the macro should trigger
    4. When user classify a excel today as Internal and open the excel tomorrow and close (with or without making changes), then also the alert message box should show.

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    And how far have you got with all this work yourself?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    UserForm:

    [VBA]
    Private Sub btnSubmit_Click()
    Dim ws As Worksheet
    Application.ScreenUpdating = False
    For Each ws In ActiveWorkbook.Worksheets
    Application.StatusBar = "Changing footer in " & ws.Name
    With ws.PageSetup
    If rdoHighlyRestricted.Value = True Then
    .LeftFooter = rdoHighlyRestricted.Caption
    ElseIf rdoRestricted.Value = True Then
    .LeftFooter = rdoRestricted.Caption
    ElseIf rdoInternal.Value = True Then
    .LeftFooter = rdoInternal.Caption
    ElseIf rdoPublic.Value = True Then
    .LeftFooter = rdoInternal.Caption
    End If
    End With
    Next ws
    Set ws = Nothing
    Application.StatusBar = False
    Unload FrmClassify
    MsgBox "Active Document Classified sucessfully", vbInformation + vbOKOnly

    End Sub


    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = 0 Then
    Cancel = True
    'MsgBox "The X is disabled, please use a button on the form.", vbCritical
    End If
    End Sub
    *************************************************************************** *********
    [/VBA]ThisWorkbook

    [VBA]
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Dim iReply As Integer
    iReply = MsgBox("Have you classified the active document?? ", vbQuestion + vbYesNo, "Classify")
    If iReply = vbNo Then
    'FrmClassify.Repaint

    FrmClassify.Show
    End If
    End Sub
    [/VBA]

  4. #4
    Hi,

    Can anyone pls help?

  5. #5
    Is there any way by which we can execute a macro across excel without having a macro in temp file using add in?

Posting Permissions

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