"Be careful! Parts of your document may include personal information that can't be removed by the document inspector"

ebeyert

Active Member
Joined
Sep 15, 2006
Messages
287
I have the following code, which works ok, but every time i save the workbook i get the message:

"Be careful! Parts of your document may include personal information that can't be removed by the document inspector"

I have no idea what this means and where in the below code is creating this message?



Code:
Sub SetLevel()' SETLEVEL sets the outline level for each selected row based on the depth of a structured number.
'   When there is no structured number, the level is set to one higher than the previous number.
'   Sets the level 0 to the first cell highlighted by the user. For example if 1.2.3 is the first
'   cell, then 1.2.3.1 is level 1 and 1.2.3.1.1. is level 2 and so forth.
'   If the first cell is not a number, then it is set to level 0, and all numbers start at 1.
 
'SYNTAX
'   The user selects the range of structured numbers within the sheet, then runs this macro.
 
'EXAMPLE
'   Let the first cell be "1." this outline level is set to 1
'   Let the next cell be "1.1." this outline level is set to 2, etc.
'   OR
'   Let the first cell be "N/A" this outline level is set to 1
'   Let the next cell be "1." this outline level is set to 2,
'   Let the next cell be "1.1." this outline level is set to 3, etc.


 
    Dim WBSRange As Range           'Range of selected cells
    Dim c As Variant                'Cell used in loop
    Dim cdepth As Long              'Depth of previous WBS (based on outline level
    Dim cValue As String            'Previous WBS Value
    Dim i As Long                   'Loop counter
    Dim endwithstop As Boolean      'True if the WBS item ends in a fullstop
    Dim startDepth As Long          'The depth of the first row
 
    'If Cells references not provided then use the selection
    'If WBSRange Is Nothing Then
    Set WBSRange = Application.Selection
    'End If
 
    'Get the depth of the first row
    'Find the depth of the WBS
    cValue = WBSRange.Cells(1, 1).Value
    i = -1
    dotpos = 1
    Do While dotpos > 0
        i = i + 1
        dotpos = InStr(cValue, ".")
        If dotpos - 1 > 0 Then
            cValue = Mid(cValue, dotpos + 1)
        End If
    Loop
    startDepth = i
 
    'Loop through each row if the selection
    For Each c In WBSRange
        'Get the WBS Value
        cValue = CStr(c.Value)
        If cValue = "" Then
            Set pCell = c.End(xlUp)
            cValue = pCell.Value
            cdepth = 1
        Else
            cdepth = 0
        End If
 
        'Determine if trailing fullstops are being used
        endwithstop = Right(cValue, 1) = "."
        If Not endwithstop Then
            cValue = cValue & "."
        End If
 
        'Find the depth of the WBS
        i = -1
        dotpos = 1
        Do While dotpos > 0
            i = i + 1
            dotpos = InStr(cValue, ".")
            If dotpos - 1 > 0 Then
                cValue = Mid(cValue, dotpos + 1)
            End If
        Loop
        cdepth = cdepth + i
 
        'Set Depth if not zero
        If cdepth - startDepth > 0 Then
            'Set the depth
            c.Rows.OutlineLevel = cdepth - startDepth
        End If
 
    Next c
 
End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Options > Trust Center > Trust Center Settings > Privacy Options > then un-check the check box that says "Remove personal information from file properties on save", then hit OK.
 
Upvote 0
I have the same issue...except my excel has ocd...and wants to give me tourettes... I unchecked the box in the trust center and that fixed it right. well it comes back up a few minutes later. I would love to know what in tarnation I am doing that Is making my excel snub its inspector nose at me.
 
Upvote 0
I have the following code, which works ok, but every time i save the workbook i get the message:

"Be careful! Parts of your document may include personal information that can't be removed by the document inspector"

I have no idea what this means and where in the below code is creating this message?



Code:
Sub SetLevel()' SETLEVEL sets the outline level for each selected row based on the depth of a structured number.
'   When there is no structured number, the level is set to one higher than the previous number.
'   Sets the level 0 to the first cell highlighted by the user. For example if 1.2.3 is the first
'   cell, then 1.2.3.1 is level 1 and 1.2.3.1.1. is level 2 and so forth.
'   If the first cell is not a number, then it is set to level 0, and all numbers start at 1.

'SYNTAX
'   The user selects the range of structured numbers within the sheet, then runs this macro.

'EXAMPLE
'   Let the first cell be "1." this outline level is set to 1
'   Let the next cell be "1.1." this outline level is set to 2, etc.
'   OR
'   Let the first cell be "N/A" this outline level is set to 1
'   Let the next cell be "1." this outline level is set to 2,
'   Let the next cell be "1.1." this outline level is set to 3, etc.



    Dim WBSRange As Range           'Range of selected cells
    Dim c As Variant                'Cell used in loop
    Dim cdepth As Long              'Depth of previous WBS (based on outline level
    Dim cValue As String            'Previous WBS Value
    Dim i As Long                   'Loop counter
    Dim endwithstop As Boolean      'True if the WBS item ends in a fullstop
    Dim startDepth As Long          'The depth of the first row

    'If Cells references not provided then use the selection
    'If WBSRange Is Nothing Then
    Set WBSRange = Application.Selection
    'End If

    'Get the depth of the first row
    'Find the depth of the WBS
    cValue = WBSRange.Cells(1, 1).Value
    i = -1
    dotpos = 1
    Do While dotpos > 0
        i = i + 1
        dotpos = InStr(cValue, ".")
        If dotpos - 1 > 0 Then
            cValue = Mid(cValue, dotpos + 1)
        End If
    Loop
    startDepth = i

    'Loop through each row if the selection
    For Each c In WBSRange
        'Get the WBS Value
        cValue = CStr(c.Value)
        If cValue = "" Then
            Set pCell = c.End(xlUp)
            cValue = pCell.Value
            cdepth = 1
        Else
            cdepth = 0
        End If

        'Determine if trailing fullstops are being used
        endwithstop = Right(cValue, 1) = "."
        If Not endwithstop Then
            cValue = cValue & "."
        End If

        'Find the depth of the WBS
        i = -1
        dotpos = 1
        Do While dotpos > 0
            i = i + 1
            dotpos = InStr(cValue, ".")
            If dotpos - 1 > 0 Then
                cValue = Mid(cValue, dotpos + 1)
            End If
        Loop
        cdepth = cdepth + i

        'Set Depth if not zero
        If cdepth - startDepth > 0 Then
            'Set the depth
            c.Rows.OutlineLevel = cdepth - startDepth
        End If

    Next c

End Sub
Do you write VBA code with word “hide”? If yes, please change that word to another one.
 
Upvote 0
Go to File > Info
and click in "Allow this information to be saved in your file".
 
Upvote 1

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

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