PDA

View Full Version : Solved: Avoid macro security warnings!



dillon65
03-07-2005, 07:02 AM
Hello everyone::hi:

This is my first thread, I know nothing about VBA programming, however, I have every intention of learning has much as possible.

My first question is does anyone know what the code would be for a word document - Avoid macro security warnings! I am very aware that this would only be for the macros which I have created on my system.

http://www.vbaexpress.com/forum/articles.php?action=viewarticle&artid=3

Second question is, what is the best possilbe way and cleanest method to deleting a VBA/Macro from a document, once you no longer need it.

Thanks you very much!

Denise

Jacob Hilderbrand
03-07-2005, 07:37 AM
1) There is no code to avoid the macro security warning, but you can add a digital signature. Just follow the instructions in the article.

2) Just delete the code (highlight it and delete). If you no longer need the module you can right click it and remove it entirely.

TonyJollans
03-07-2005, 07:53 AM
Hi Denise,

I'm not quite sure what you're asking here. You cannot disable macro security warnings in code - that would defeat the point of them, they are there so that code cannot run without the User's permission. What is it in the article you are having trouble with?

The answer to the second question depends on where the macro is and whether there are any other macros in the same place. If the code is in a standard module and there is no other code there then remove the module; if it is in the ThisDocument module then select it and delete it - you can't remove the module.

I see Jake beat me to it. I'm glad we said the same thing!

Oh, My! Isn't that clever! I thought I was adding a new post and the site merged it on to my last one. Smart coding by someone. Well done!

dillon65
03-07-2005, 09:07 AM
Hello Mr. Jollans, DRJ:

I do apologise to the both of you, if I was incorrect with my first question.
I was able to get through most of the procedure for Avoid macro security warnings!

However, I stumbled with the third image, if you look to the right hand side of the image there is this coding, do I need to create this, or is the coding just a part of the file, which is used for the sample?

As for the second question, thanks for letting me know, I used the Macro "Alt F8 command and just delete the macro from the Macro box.

Thanks for your support!

Denise

TonyJollans
03-07-2005, 09:20 AM
Hi Denise,

The coding is just part of the file used for the sample - you sign your own projects with your own code.

dillon65
03-07-2005, 09:50 AM
Hello Mr. Jollans:

Thank you for your quick reply, hopefully I will be up to speed, with the VBA lingo soon!

Appreciate your support!

Denise

Howard Kaikow
03-08-2005, 08:05 AM
Hello everyone::hi:

This is my first thread, I know nothing about VBA programming, however, I have every intention of learning has much as possible.

My first question is does anyone know what the code would be for a word document - Avoid macro security warnings! I am very aware that this would only be for the macros which I have created on my system.

http://www.vbaexpress.com/forum/articles.php?action=viewarticle&artid=3

Second question is, what is the best possilbe way and cleanest method to deleting a VBA/Macro from a document, once you no longer need it.

Thanks you very much!

Denise

in word 2003 Help, see the following topics:

Macro security levels
About template locations

It is alleged that macros in "trusted locations" are not subject to the security restrictions.

TonyJollans
03-08-2005, 09:22 AM
Howard,

This has always (since 97 anyway) been the case and, to my mind, is an appaling hole. Any program can (and always could) write to such "trusted locations" without asking the User, and have code triggered to run on Office apps startup. This tends to happen on product install but can happen at any time.

I did notice that Microsoft have started to admit it. I suppose that's a step in the right direction.

Brandtrock
03-08-2005, 10:30 AM
Howard,

This has always (since 97 anyway) been the case and, to my mind, is an appaling hole. Any program can (and always could) write to such "trusted locations" without asking the User, and have code triggered to run on Office apps startup. This tends to happen on product install but can happen at any time.

I did notice that Microsoft have started to admit it. I suppose that's a step in the right direction.

A M$ application with a gaping security hole? Well, I never!! :bug:

Howard Kaikow
03-08-2005, 11:37 AM
Howard,

This has always (since 97 anyway) been the case and, to my mind, is an appaling hole. Any program can (and always could) write to such "trusted locations" without asking the User, and have code triggered to run on Office apps startup. This tends to happen on product install but can happen at any time.

I did notice that Microsoft have started to admit it. I suppose that's a step in the right direction.

There's other holes, but we should not be discussing them. I thought that the charter of VBAEXpress forbade such discussions anyway. Has that changed?

One of the points of .NET is that Office security settings are ignored and the "real" security of .NET is applied instead when automating an office app with, say, VB .NET.

Sew, eye expect that we will see a drastic change to the Office security model when office is fully .net-ized.

TonyJollans
03-08-2005, 12:01 PM
There's other holes, but we should not be discussing them. I thought that the charter of VBAEXpress forbade such discussions anyway. Has tat changed?

I don't see any problem with discussing, and making people aware of, security issues. What we have agreed not to do is tell people how to break security that is in place (however weak), for example by cracking passwords.

Anyway, it was you who brought it up!!

Howard Kaikow
03-08-2005, 12:10 PM
I don't see any problem with discussing, and making people aware of, security issues. What we have agreed not to do is tell people how to break security that is in place (however weak), for example by cracking passwords.

Anyway, it was you who brought it up!!

dillon65 brought it up.

Brandtrock
03-08-2005, 12:19 PM
in word 2003 Help, see the following topics:

Macro security levels
About template locations

It is alleged that macros in "trusted locations" are not subject to the security restrictions.

dillon65 brought up macro security, you brought up the hole.

Howard Kaikow
03-08-2005, 12:27 PM
dillon65 brought up macro security, you brought up the hole.

Tony brought up the first hole, I brought up the 2nd hole.
16 more and we can play golf.

Brandtrock
03-08-2005, 03:35 PM
Fore!! :clap: