VBA Renaming Controls

R

Rob

This has happened about 4 times already so I am about to scrap VBA as
a solution for anything.

Without having ANY other Word docs with VBA controls on them open,
Word is adding the number "1" to the end of the control name. I am
highly versed in Visual Basic 6.0 and understand that when a control
is copied and pasted in VB, it adds the number 1 to the name. Here is
my scenario specifically:

Open the doc, make some code changes, validate that it works, save the
doc, close it. Open that same doc, and checkbox named chkAuto is now
chkAuto1, with the code-behind still associated with chkAuto.

Like I said, this has happened about 4 times already.

HELP!!!
 
H

Howard Kaikow

Rob said:
This has happened about 4 times already so I am about to scrap VBA as
a solution for anything.

Without having ANY other Word docs with VBA controls on them open,
Word is adding the number "1" to the end of the control name. I am
highly versed in Visual Basic 6.0 and understand that when a control
is copied and pasted in VB, it adds the number 1 to the name. Here is
my scenario specifically:

Open the doc, make some code changes, validate that it works, save the
doc, close it. Open that same doc, and checkbox named chkAuto is now
chkAuto1, with the code-behind still associated with chkAuto.

Like I said, this has happened about 4 times already.

HELP!!!

I've never seen that behavior, but I have seen controls get corrupted,
sometimes necessitating deletion and recreation of the control.

Try rebuilding a clean document, then adding the controls.
 

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