ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Macro error (https://www.excelbanter.com/excel-programming/282380-help-macro-error.html)

altoonaPillarRock

Help with Macro error
 
I created a set of workbooks that use a common addin. The addin shows the
userform and processes it. I put the workbooks in a folder on a file server
and digitally signed each workbook and the addin.

The first time users put their information in the workbooks and the file is
reopened this message occurs:

"The macros in this file do not match the digital signature. Only a macro
virus would cause this. Please scan for viruses, and notify the publisher of
this document. Macros will be disabled."

When scanned by McAfee no viruses appear.

If I open another one of the workbooks and save my changes this doesn't
occur.

Here is the code in sheet1 of each workbook:

Sub lblNew_Click()
show_userForm
End Sub

Here is the code in module1 of the addin:

Sub show_userForm()
UserForm1.Show
End Sub

Here is the code in userForm1 of the addin:

Sub cmdCancel_Click()
Unload UserForm1
End Sub

Sub cmdOK_Click()
' Validate the Project Name
If txtProject.Text = "" Then
MsgBox "You must enter a Project Name!"
txtProject.SetFocus
Exit Sub
End If

' Validate the Business Unit
If TxtUnit.Text = "" Then
MsgBox "You must enter a Business Unit!"
TxtUnit.SetFocus
Exit Sub
End If

' Validate the Sponser
If TxtSponsor.Text = "" Then
MsgBox "You must enter a Sponser Name!"
TxtSponsor.SetFocus
Exit Sub
End If

' Validate the CWA
If TxtCWA.Text = "" Then
MsgBox "You must enter a CWA!"
TxtCWA.SetFocus
Exit Sub
End If

' Validate the Salco
If TxtSalco.Text = "" Then
MsgBox "You must enter a Salco!"
TxtSalco.SetFocus
Exit Sub
End If

'Validate the category of work 0r optTraining or optAdmin
If Not optProject And Not optTraining And Not optAdmin Then
MsgBox "You must select a category!"
optProject.SetFocus
Exit Sub
End If

' get the top row in the insert area
Rows("4:4").Select
Selection.Insert Shift:=xlDown
Range("A4").Select

' Transfer the information
With ActiveCell
.Offset(0, 0) = txtProject.Text
.Offset(0, 1) = Now()
.Offset(0, 2) = TxtUnit.Text
.Offset(0, 3) = TxtSponsor.Text
.Offset(0, 4) = TxtPool.Text
.Offset(0, 5) = TxtCWA.Text
.Offset(0, 6) = TxtSalco.Text
End With

' Transfer the category of work
If optProject Then ActiveCell.Offset(0, 7) = "Project Management"
If optTraining Then ActiveCell.Offset(0, 7) = "Training"
If optAdmin Then ActiveCell.Offset(0, 7) = "Administration"

' Close form
Unload UserForm1
End Sub






All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com