Active X Controls ?

C

ChasAA

This is my first post =).

I am using Word VBA in which I have controls such as CommandButton1 and
Terminal1. Whilst CommandButton1 is a "Word VBA" control. The Terminal! is
I think what is called an ActiveX control. It is part of a DLL file.

My problem is that since we have gone Windows XP Professional, every now and
then my macros stop working and the debug screen comes up.

This is because the control names have changed (seemingly by themselves).
The macros are password protected and I don't think any of the users would
even know how to change the control names! There is also a pattern to how
the controls are renamed.

CommandButton1 becomes CommandButton11

Terminal1 becomes Terminal11

if I had say a control cmbFlights12 this would become something like
cmbFlights121 or cmbFlights122.

This does not happen on all sets.

Can any help please, sorry if my terminology was incorrect.

Many thanks.

Chas
 
C

Cindy M -WordMVP-

Hi Chas,

Both CommandButton1 and Terminal1 are ActiveX controls; the difference between
them is (probably) that the button is one that comes with Office, while you've
added the other from another source. The Office tools (Controls Toolbox) were
actually designed for the Office userForms package.

1. Which version of Word are you using?

2. Where are you seeign "Word VBA" for the button control?

3. The Office applications manage ActiveX controls a bit "oddly". Certain
actions can cause the control to be deleted and recreated. If you have not
explicitly assigned a name to a control, it will usually be renamed under these
circumstances.

However, I would *not* expect this to happen to controls which have been
renamed (your cmbFlights121 example). OTOH, exactly how Word decides to handle
a third-party control is unpredictable. So if you're seeing this example with a
non-Office control, it probably has something to do with how it was created.
I am using Word VBA in which I have controls such as CommandButton1 and
Terminal1. Whilst CommandButton1 is a "Word VBA" control. The Terminal! is
I think what is called an ActiveX control. It is part of a DLL file.

My problem is that since we have gone Windows XP Professional, every now and
then my macros stop working and the debug screen comes up.

This is because the control names have changed (seemingly by themselves).
The macros are password protected and I don't think any of the users would
even know how to change the control names! There is also a pattern to how
the controls are renamed.

CommandButton1 becomes CommandButton11

Terminal1 becomes Terminal11

if I had say a control cmbFlights12 this would become something like
cmbFlights121 or cmbFlights122.

This does not happen on all sets.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
C

ChasAA

Hello Cindy,
Firstly, thank you very much for taking the time to reply. The way I
phrased "Word VBA" I now think is misleading.

CommandButton1 (I originally described as Word VBA" control) is one from the
Microsoft Control Toolbox. (I am not seeing the words "Word VBA" anywhere I
just referred to it like that.

The second control "Terminal1" is from a third party. It is used to access
our airline Reservations system SABRE.

Do you think think I should rename them to cmdBegin and getSABRE or
something like that? (ie something other than what they are called as a
default).

My workaround has been a simple batch file that renames one file to the the
usable name.
I placed two files in the folder, one is printVCR.doc and the other
printVCRCopy.doc then I have an icon to run a batch file "FixVCR.bat" which
simply:

echo off
c:
cd \VCR
erase printVCR.doc
copy printVCRcopy.doc printVCR.doc

Luckily the printVCRcopy has not corrupted so far, when it does I will have
to replace that with a copy that I have.

Thanks again,
sincerely

Chas
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Q2hhc0FB?=,
Do you think think I should rename them to cmdBegin and getSABRE or
something like that? (ie something other than what they are called as a
default).
Yes, you should try that. You can do it in the "Properties" window.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

ChasAA

I will do that, but I may not know for weeks/months if it has worked because
the error only comes up whenever it feels like it. Sometimes not for weeks.
But I have a very good feeling that this is going to work!!. Thanks again

Chas
 

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