POV-Ray : Newsgroups : povray.off-topic : VBA (Very Bad Answer?) Server Time
11 Oct 2024 07:13:36 EDT (-0400)
  VBA (Very Bad Answer?) (Message 1 to 10 of 36)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: VBA (Very Bad Answer?)
Date: 6 Dec 2007 05:41:54
Message: <4757d1f2$1@news.povray.org>
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.

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

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.

(By default they install VBA but not the tools apparently necessary to 
actually enable it to run. But then, have you *seen* VBA? I guess the 
assumption that you won't want to use it is fairly safe...)

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!")

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

5. Open the spreadsheet.

6. Open the VB Editor.

7. Find the right menu item.

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...)

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...)

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


Post a reply to this message

From: scott
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 06:32:24
Message: <4757ddc8$1@news.povray.org>
> All this fuss just so I can click a button to put today's date in a cell 
> on the spreadsheet... sheesh!

Or you could just have gone to Options -> Security and turned down Macro 
security to Medium, then at least you get the old style "do you want to run 
this or not" box for unsigned macros...


Post a reply to this message

From: Phil Cook
Subject: Re: VBA (Very Bad Answer?)
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

From: Invisible
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 07:23:42
Message: <4757e9ce@news.povray.org>
Phil Cook wrote:

> 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"

Well I pretty much assumed it would be an on/off settings, and even I am 
not too keen on turning the security off completely.

>> 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 :-)

I followed the instructions you gave me for Office 97 and they didn't 
work. (I forget where exactly it fails.) The instructions I found here 
actually worked.

>> 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

Actually I used a command prompt, but hey.

>> 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"?

I did follow the instructions for backing up the certificate, but 
apparently "the private key is marked as not exportable and cannot be 
saved". So you can save the certificate itself, just not the key. Very 
helpful.

>> 7. Find the right menu item.
> 
> Tools|Digital Signature.. at least on 2k, hardly surprising.

It's easy once you figure out it's under Tools, yes.

>> 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.

Interesting. So if you change something when you didn't mean to, it 
updates the signature? Oh dear...

>> 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.

Until the next time I reinstall Windoze...

PS. Does OpenOffice provide a scripting language?


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 07:42:21
Message: <4757ee2d$1@news.povray.org>

> PS. Does OpenOffice provide a scripting language?

Several of them, it seems:
http://framework.openoffice.org/scripting/index.html

I never used that, though...

-- 
Vincent


Post a reply to this message

From: Invisible
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 07:50:02
Message: <4757effa$1@news.povray.org>
Vincent Le Chevalier wrote:

>> PS. Does OpenOffice provide a scripting language?
> 
> Several of them, it seems:
> http://framework.openoffice.org/scripting/index.html
> 
> I never used that, though...

"OpenOffice Basic"? Oh, that's original...


Post a reply to this message

From: Phil Cook
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 07:55:11
Message: <op.t2wzd90ec3xi7v@news.povray.org>
And lo on Thu, 06 Dec 2007 12:23:41 -0000, Invisible <voi### [at] devnull> did  
spake, saying:

> Phil Cook wrote:
>
>> 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"
>
> Well I pretty much assumed it would be an on/off settings, and even I am  
> not too keen on turning the security off completely.

No amazingly they did add an adult option alongside the absolutes.

>>> 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 :-)
>
> I followed the instructions you gave me for Office 97 and they didn't  
> work. (I forget where exactly it fails.) The instructions I found here  
> actually worked.

Hmm okay.

>>> 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
>
> Actually I used a command prompt, but hey.
>
>>> 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"?
>
> I did follow the instructions for backing up the certificate, but  
> apparently "the private key is marked as not exportable and cannot be  
> saved". So you can save the certificate itself, just not the key. Very  
> helpful.

Try makecert instead.

>>> 7. Find the right menu item.
>>  Tools|Digital Signature.. at least on 2k, hardly surprising.
>
> It's easy once you figure out it's under Tools, yes.

or read the article you linked to :-)

-- 
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

From: Invisible
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 07:57:55
Message: <4757f1d3@news.povray.org>
>> I followed the instructions you gave me for Office 97 and they didn't 
>> work. (I forget where exactly it fails.) The instructions I found here 
>> actually worked.
> 
> Hmm okay.

Well, to be honest it's getting quite hard to find information about 
Office 97. Hopefully Office 2003 will be an easier proposition...

>> I did follow the instructions for backing up the certificate, but 
>> apparently "the private key is marked as not exportable and cannot be 
>> saved". So you can save the certificate itself, just not the key. Very 
>> helpful.
> 
> Try makecert instead.

It's not there.


Post a reply to this message

From: Phil Cook
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 09:14:12
Message: <op.t2w2zac4c3xi7v@news.povray.org>
And lo on Thu, 06 Dec 2007 12:57:53 -0000, Invisible <voi### [at] devnull> did  
spake, saying:

>>> I followed the instructions you gave me for Office 97 and they didn't  
>>> work. (I forget where exactly it fails.) The instructions I found here  
>>> actually worked.
>>  Hmm okay.
>
> Well, to be honest it's getting quite hard to find information about  
> Office 97. Hopefully Office 2003 will be an easier proposition...

Well at least until Office 2010

>>> I did follow the instructions for backing up the certificate, but  
>>> apparently "the private key is marked as not exportable and cannot be  
>>> saved". So you can save the certificate itself, just not the key. Very  
>>> helpful.
>>  Try makecert instead.
>
> It's not there.

GIYF

-- 
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

From: Jim Henderson
Subject: Re: VBA (Very Bad Answer?)
Date: 6 Dec 2007 12:37:44
Message: <47583368$1@news.povray.org>
On Thu, 06 Dec 2007 12:50:02 +0000, Invisible wrote:

> Vincent Le Chevalier wrote:
>> Invisible a écrit :
>>> PS. Does OpenOffice provide a scripting language?
>> 
>> Several of them, it seems:
>> http://framework.openoffice.org/scripting/index.html
>> 
>> I never used that, though...
> 
> "OpenOffice Basic"? Oh, that's original...

It's descriptive.  You'd be happier if it was called, I don't know, 
"OpenOffice Splash"?

Jim


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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