security warning richtextbox

R

RB Smissaert

I am using a RichTextBox control (Microsoft Rich Textbox Control 6.0 (SP6))
on a VBA Userform in Excel.
There is no problem in Excel 2002 and 2003, but in Excel 2000 there is a
security warning:
This application is about to initialize ActiveX controls that might be
unsafe. If you trust the source of this file, select OK and the controls
will be initialized using your current workspace settings.
It is not a major problem, but I understand this warning can be avoided if
the RichText control is somehow wrapped in another control. Can't find
though how this should be done.
I need the RichTextBox for colour formatting of SQL keywords.
Any suggestions for a workaround of this are appreciated.

RBS
 
R

RB Smissaert

Hi Peter,

Well, I definitely get it in 2000 and not in 2002 or 2003, athough I had the
warning once after I upgraded my XL 2002 to 2003, but never after.
My helpfile writer however gets it in 2003 and has major problems with this,
to the extent that it crashes Excel and
the add-in can't be used. This is on Windows 2000. She admits though that
her system may need a cleanup.

Maybe this newsgroup thread shows the solution to these major problems:
http://groups.google.co.uk/group/mi...003+richtextbox&rnum=6&hl=en#76252635e022bb41

I am not sure if it is relevant that I have VB6 on my system and the control
seem to have been updated with SP6:
Microsoft Rich Textbox Control 6.0 (SP6)

The control itself works perfect and it is very nice indeed to colour format
the SQL.

RBS
 
P

Peter T

Hi Bart,

Like you I also have vb6 and the Microsoft Rich Textbox Control 6.0 (SP6).

All works fine if I create my own, or receive as a vba from someone else, in
my W98 Xl2000.

However I assume users would simply require to be installed the current
versions of
richtx32.ocx (the RTB "wrapper" for) and riched20.dll
(subject the various security issues)

Another link which overall I read as a rather surprising state of affairs.

http://support.microsoft.com/default.aspx?scid=kb;en-us;838010

This also makes mention of creating a "container" control to host the RTB
control.

Hmm, a container for the wrapper, sounds like Russian dolls!

Regards,
Peter T
 
R

RB Smissaert

Hi Peter,

The person having the problems has VB6 installed, but not SP6.
She has exactly the same version as my .ocx file, but not sure about the
dll.
I could no wiser either from making a wrapper of a container for the RTB.
I read the article you mentioned but the resolution in there was a bit vague
and sparse to say the least.
Still, it might be the way to go, although it all runs fine in my Excel
2003.

RBS
 
L

LouKur

This message is caused by missing registry settings for Office and VBA.
Microsoft has a somewhat comprehensible article on this at URL
http://support.microsoft.com/default.aspx?scid=kb;en-us;827742


You have two add 2 registry keys, each getting 1 value. I hate using
RegEdit and am used to sending registry entries to lots of people as
software distributions. You can either follow the numerous steps in the
Microsoft article or you can build a ".reg" object and run it.
These are just text files with the extension ".reg".

I created "AllowActiveX.reg" using Wordpad. Below is what goes in
it:


REGEDIT4

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Common\Security]
"UFIControls"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\VBA\Security]
"LoadControlsInForms"=dword:00000001


Save the object and double click on it. Windows will give you a
"Yes/No" box asking if you want to add the entries. You have to
click "Yes".

You do not have to reboot after. The message goes away as soon as the
two registry entries are added.
 
R

RB Smissaert

Thanks for that, I will give it a go on the 2000 machine.
What about security though?
Would doing this regedit affect it in any serious way?

RBS
 
R

RB Smissaert

It has made the message gone away indeed.
Still, maybe it is better to make a usercontrol in VB6, based on the
RichTextBox that hasn't got this security
problem. Only problem is I never have made usercontrols in VB.

RBS
 
R

RB Smissaert

Looks I only need to add the second key:

[HKEY_CURRENT_USER\Software\Microsoft\VBA\Security]
"LoadControlsInForms"=dword:00000001

And I think that will do fine.

RBS
 
R

RB Smissaert

LouKur,

Are these 2 keys for different Office version or do they address different
things?
I am trying to find out if I could do without the first one.
If they were indeed for different Office version would there be any harm in
adding
both or should I determine the Excel version (which can be tricky with
different
installs on the same system) and add the key accordingly?

RBS
 
L

LouKur

I got the same results as you, with the second value begin the one that
stopped the message for Excel. The Microsoft article I show the link to
is not all that clear on what the other one does. One way of reading
the Microsoft article is that there is a difference between Office 2003
and Office XP. I am using Office Professional 2003.

If you have at least 10 years left before retirement age, you could
always ask Microsoft...
 
R

RB Smissaert

LouKur,

Have tested on Excel 2000 and 2003 and adding the second one fixed the
problem for both.
Not sure why it happened in 2000 in the first place as I thought that this
was a new security feature in 2003.
For now I will only put the second regedit in my INNO install file.

I got more than 10 years left (I hope) but I think I will give asking MS a
miss.
There isn't much information available about this. Maybe this control isn't
used that much in the Office apps.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top