ashaneharris
New Member
- Joined
- Mar 18, 2019
- Messages
- 1
[FONT="]I do not know if this is possible but basically I would like to have the spreadsheet check a folder, then return excel file names and whether the document is signed. I've tried a few things that don't seem to work.[/FONT]
[FONT="]
[/FONT]
[FONT="]First I wrote this code to list all files within the folder:
Now I need a way for the macro to go through and mark whether or not it was signed with a digital signature. All I have managed to think of is this but I don't know who to accurately have this test in the loop as well or have it tell me if they are signed:
[/FONT]
[FONT="]
[/FONT]
[FONT="]First I wrote this code to list all files within the folder:
Code:
[COLOR=#222222][FONT="]Sub Test()[/FONT][/COLOR][/FONT][/COLOR]
[FONT="]'Declared variables as objectsDim objFSO As ObjectDim objFolder As ObjectDim objFile As ObjectDim i As Integer'Create an instance of the FileSystemObjectSet objFSO = CreateObject("Scripting.FileSystemObject")'Get the folder object, declare the filepath to the folderSet objFolder = objFSO.GetFolder("G:\Cash Management\Accounts Payable\Vendor Statement Recons\FY19\Q3\January\Approved")i = 1'Loops through each file in the directory and prints their names and pathFor Each objFile In objFolder.Files'Print file nameCells(i + 1, 1) = objFile.Namei = i + 1Next objFile [/FONT][COLOR=#D7DADC][FONT="][COLOR=#222222][FONT="]End Sub[/FONT][/COLOR]
Now I need a way for the macro to go through and mark whether or not it was signed with a digital signature. All I have managed to think of is this but I don't know who to accurately have this test in the loop as well or have it tell me if they are signed:
Code:
[COLOR=#222222][FONT="]If Sheet1.Signatures.Count = 0 Then[/FONT][/COLOR][/FONT][/COLOR]
[FONT="] Sheet1.CommandButton1.Visible = True Else Sheet1.CommandButton1.Visible = False [/FONT][COLOR=#D7DADC][FONT="][COLOR=#222222][FONT="] End If[/FONT][/COLOR]