Running VBA find method on a workbook with a signature

crewaustin66

Board Regular
Joined
Jun 11, 2014
Messages
82
I have a workbook with macros. The workbook has a signature on it that locks it down from being editable. That's fine. The problem is that most of my macros works fine except for the ones that do a range().Find and I don't know why that fails. Has anyone seen this and gotten around it before?

Example code:
Code:
Function IsGLSUSheet(sheet As Object) As Boolean    ' 2034 5/20/14 -car- Added function to determine if a sheet looks like a GLSU sheet.
    Dim bk As Range
    Dim bs As Range
    On Error Resume Next
    
    Set bk = sheet.Range("A:A").Find("BKPF")
    Set bs = sheet.Range("A:A").Find("BSEG")
    If bk Is Nothing Or bs Is Nothing Then
        IsGLSUSheet = False
    Else
        IsGLSUSheet = True
    End If
End Function

When the document is not signed, this works fine. When it is signed, the .Find methods always return "nothing".

Thanks,
Crew
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
The fact that it's digitally signed should make no difference.
if you remove this line
Code:
On Error Resume Next
what happens?
Also how are you calling the function?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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