Quantcast
Channel: SCN : All Content - SAP BusinessObjects Analysis, edition for Microsoft Office
Viewing all articles
Browse latest Browse all 1606

Trusted VBA Code

$
0
0

If you have VBA coding in AO workbook the most annoying message is:

 

vba_message.jpg

What happend?

 

Excel is by default configured to decline all VBA code inside of your workbook. In this specific case Excel asks the user if he wants to enable the macros for a specific workbook. That’s a session related prompt and you will be asked again to enable the content.

 

 

To change that behavior you have to open the Macro Settings

(Options => Trust Center => Trust Center Settings => Macro Settings)

excel_settings.jpg

Obviously the last option is the easiest one, BUT with least security.

 

The option to sign the macros sounds like the most interesting one. But how to do that?

 

At first you need a certificate. Open the tool “Digital Certificate for VBA Projects”

(In Microsoft Windows XP, on the Windows Start menu, point to All Programs, point to Microsoft Office Tools, and then click Digital Certificate for VBA Projects. In Microsoft Windows 2000, on the Windows Start menu, point to Programs, point to Microsoft Office Tools, and then click Digital Certificate for VBA Projects.)

 

create_certificate.jpg


As you can read here you can use this type of certificate only to test it locally, for using it in your company you have to use one of the commercial certificates provided via the link.

 

In case you want this certificate as a trusted certificate follow the guide “Adding certificates to the Trusted Root Certification Authorities store for a local computer“ herehttp://technet.microsoft.com/en-us/library/cc754841.aspx#BKMK_addlocal

 

After your certificate is created, open your VBA project. Go to “Tools”->”Digital Signature”.

 

choose_certificate.jpg

 

With "Choose" you can select your certificate:

select_certificate.jpg


After that the certificate is selected. You can save the document.

 

After opening the document you will get ONCE the following security warning:

warning_certificate.jpg

 

After "YES" you will never get bothered again.


Viewing all articles
Browse latest Browse all 1606

Trending Articles