How do I delete a signature from an Excel document using Office automation

Posted by Guy Marom on Stack Overflow See other posts from Stack Overflow or by Guy Marom
Published on 2010-05-17T07:34:29Z Indexed on 2010/05/17 7:40 UTC
Read the original article Hit count: 304

Filed under:
|
|

Hello, I have a signed Excel workbook and I want to delete the signature from it. The problem is that when I try to delete the signature there's a prompt for confirming the deletion and I want the process to be fully automatic. Here's a code sample, the prompt appears when the last line executes:

Dim source As String = "c:\temp\signed.xlsx"
Dim app As New Application()
app.Visible = True
Dim book As Workbook = app.Workbooks.Open(source, UpdateLinks:=0)
app.ShowToolTips = False
Dim sig As Microsoft.Office.Core.Signature = book.Signatures.Item(1)
sig.Delete()

Thanks

© Stack Overflow or respective owner

Related posts about excel

Related posts about api