0

If I have many macro workbooks open at the same time...

Some names such as UserForm, Module, etc. overlap. How to fully qualified names from VBA project?

for example:

VBAProject(ThisWorkbook.Name).UserForm1.CommandButton1.Caption
MyNameOfProject(ThisWorkbook.Name).UserForm1.CommandButton1.Caption

When the user renames the workbook, the project name remains the same... Ideally completely avoid the workbook name, if posible?

In one workbook, for example, there is a module with a function that I would like to use from the other workbook. In general, I want things to be under control. Fully qualified as much as possible.

excel222
  • 9
  • 3
  • If you are calling a function in another workbook you need to reference its name somehow. – SJR Jun 03 '21 at 11:02

1 Answers1

0

When you are referring to userform within the same work, you can just use:

From:

MyNameOfProject(ThisWorkbook.Name).UserForm1.CommandButton1.Caption

To:

UserForm1.CommandButton1.Caption

However, for referring userform from another workbook, please avoid to do so...

Kin Siang
  • 2,644
  • 2
  • 4
  • 8