Guy Marom
Guy Marom

Reputation: 11

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

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

Upvotes: 0

Views: 1368

Answers (2)

user517611
user517611

Reputation: 11

using Aspose.Cells 5.2.0.0 can add and remove digital signature in excel 2007

Upvotes: 1

Guy Marom
Guy Marom

Reputation: 11

I ended up using the SaveAs function of the Workbook object. Saving a copy of the document removes any signatures. I'd still like to hear if there's a more elegant solution though.

Upvotes: 0

Related Questions