can I add a vba to a page so that it updates a date if I save the page after altering it?

matelot2

New Member
Joined
Feb 1, 2012
Messages
36
I understand if I add
Code:
 Private Sub workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Sheets("cable 1c").Range("G1").Value = Date
 Sheets("cable 1d").Range("G1").Value = Date
 Sheets("cable master").Range("D54").Value = Date
 Sheets("box master").Range("D54").Value = Date
 Sheets("cable 5").Range("B1").Value = Date
 End Sub
it will change the date as above.
My problem is that when I start excel up now I get a box that tells me
Macro's are disabled because the security level is set to high and a digitally signed trusted certificate is not attached to the macro.......request the macros be signed by the author using a certificate issued by a certificate authority.
Is says I may encounter this error for the following reasons
....one being
macro security is set to high .... which it is. ... and ...
the application encounters a signed macro, but you selected Disable when prompted by the macro warning dialog when opening the file. Use the following procedure to enable the macro:
Close the file and any other instances of the application currently running on the computer (close all applications that also use the application you are currently running).
Open the file again and examine the certificate of trust details and set the Always trust macros from this publisher box if you trust the certificate issued by the publisher.
Click the Enable button to allow the macro to run.


Where are the certificate of trust details? They are not on tools/macros/security.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
2003
I have found the certificate page and signed the macro but I can only find how to sign it untrusted and unless I lower my protection to medium I can't pick it up on another computer. The file is for a number of us to keep up with a list of cables and I understand it is not a good idea to lower security to medium so I want to be able to sign it with a trusted certificate so the other computers accept it.
Is it possible to do this?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,247
Messages
6,189,864
Members
453,576
Latest member
djwexcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top