views:

46

answers:

1

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

A: 

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.

Guy Marom