POV-Ray : Newsgroups : povray.off-topic : VBA (Very Bad Answer?) : Re: VBA (Very Bad Answer?) Server Time
11 Oct 2024 05:19:08 EDT (-0400)
  Re: VBA (Very Bad Answer?)  
From: Phil Cook
Date: 6 Dec 2007 06:59:59
Message: <op.t2wwvlwac3xi7v@news.povray.org>
And lo on Thu, 06 Dec 2007 10:41:58 -0000, Invisible <voi### [at] devnull> did  
spake, saying:

> Well anyway, today I *finally* got my Excel spreadsheet working again!
>
> It stopped working when I upgraded from Office 97 to Office 2003.  
> Specifically, my VBA macro was disabled. (Damn it, I spent *hours*  
> writing that thing! I *want* it to work!!)
>
> Apparently it's disabled as a security measure. You'd *think* there  
> would be a button you could just press to say that *this* macro is OK to  
> run. (That's what Office 97 had.) But no, apparently that would be too  
> easy.

As Scott said you just turn down the security options from "I'm an idiot  
protect me" to "I'm a grown-up let me make my own decisions"

> Google did at least manage to find me a relevant article without much  
> ado.
>
> http://msdn2.microsoft.com/en-us/library/aa141471(office.10).aspx

or you could have checked your posts as I've told you how to do this twice  
now :-)

> It turns out that the correct process for enabling a macro that you  
> wrote to run on your own PC is as follows:
>
> 1. Find the product installation CD.
>
> 2. Install the certificate tools.
>
> 3. Nagivate several system folders. (You know, the ones where Windows  
> Explorer insists "This is dangerous. We have hidden it for your own  
> safety. Do you *really* want to touch this stuff? We warned you!")

or run a search for selfcert.exe

> 4. Run the certificate creation tool. This creates a self-signed  
> certificate which you cannot export or back up. (Yay!)

Um you mean except when you go to sign it, view details and pick "Copy to  
file"?

> 5. Open the spreadsheet.
>
> 6. Open the VB Editor.
>
> 7. Find the right menu item.

Tools|Digital Signature.. at least on 2k, hardly surprising.

> 8. Select the certificate you just created and add the signature.
>
> 9. Save the spreadsheet.
>
> 10. Close the spreadsheet.
>
> 11. Reopen the spreadsheet.
>
> (The instructions fail to mention that the code being signed doesn't  
> help you until the *next* time you open the thing...)

Well yeah by default the macros are disabled so you need to reopen it for  
the signature to be taken into account then it should say signed by blah  
trust this certificate and that's it.

> I wonder - how do you develop new code if it's always disabled until you  
> sign it? (And - one hopes - every time you change it this invalidates  
> the signature...)

It gets re-signed if the certificate that originally signed it is present,  
so someone else souldn't re-sign the code and distribute it unless they  
were using your computer/login, besides you should lock the project for  
viewing anyway.

> All this fuss just so I can click a button to put today's date in a cell  
> on the spreadsheet... sheesh!

But all that hassle was a one-off you've now got a certificate to sign  
anything VBA with.

-- 
Phil Cook

--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.